View Single Post
Jerrythabest

JCF Member

Joined: Apr 2005

Posts: 2,602

Jerrythabest is a forum legendJerrythabest is a forum legendJerrythabest is a forum legend

Jul 3, 2012, 09:09 AM
Jerrythabest is offline
Reply With Quote
I've made some more progress today. I've been digging deeper into how JJ2 handles player cameras and splitscreen and I think making a 3D mode is not going to be as easy as I had hoped. Still, it should be possible.


I've found that in JJ2, every subscreen has exactly the same size (they share the same width/height setting). However, the position where each subscreen is drawn on-screen is set per player (in memory there are 32 blocks of 1444 bytes, each storing data about one player; 16 of these bytes contain the camera's drawing position). This has an important implication: it's not possible to draw two cameras for the same player. A second player slot must be used to be able to draw the second camera.

JJ2 will draw a camera image if a specific player slot is of a local player and that player is visible in the F9 list (this is an optimisation; if you minimize JJ2 it will remove you from the F9 list and thus also stop drawing your camera).
(Fun fact: it's possible to spectate, say, 30 players at the same time. You need to set the camera size to 128x80, remove the local player check, and set the drawing positions of each player's camera so they tile nicely. Full server spectation mode, yay!)


Back on topic...
So, what needs to be done to get 3D mode working?
-Introduce a second player (or a third and a fourth, in 2 player mode) to allocate the extra player structures (not so difficult)
-Force them outside the level area (somewhat harder to do I guess)
-Get their respective cameras to follow the wrong rabbit! (no idea how as of now)


This project is getting closer to the point that I'm really hoping for some input from more experienced JJ2 hackers!
__________________