Results 1 to 1 of 1
Thread: Design Question.
- 09-27-2010, 04:21 AM #1Member
- Join Date
- Sep 2010
- Rep Power
Ah! My first query! :)
Alright guys and gals. Let's get into the thick of it right away. But first, a little explanation. (It'll be short I promise).
I'm doing a game.
It has space ships.
At the moment it's not defined if the universe will be finite or not but I tend toward infinite.
There will be a story.
Might even have multi-player but that's undefined yet.
I will use jMonkey.
Now. I'm juggling with different possibilities to define how the finite/infinite universe will be handled.
ArrayLists of multidimensional arrays. These could be 20x20x20.
The player could exist in a smaller array that would be updated with a positioning system via a position-getting scheme from the "existing universe".
Supposing the player exist in a 3x3x3 array: As the player moves toward the edge of the universe, the game formats 3 (size of player's array) new blocks contiguous to his relative position and facing. If the player is moving really fast, the system could extrapolate more "blocks".
I'm thinking of using an array for the player because the world around him would have to be drawn and it's inside those boundaries that it would be. I certainly don't think it would be a good idea to draw the whole "universe". Thus why I think a 3x3x3 array would be a good idea.
Since space is a pretty empty place (relatively-speaking), even though if those arrays are big, they wouldn't hold much data.
Very similar to #1, but with a twist.
I'm also thinking to use "sub-arrays" in the above 20x20x20. Each would define the area's local space. Those could ALSO be segregated into arrays to local systems. Finally, the ship would be in a very small array that would be used as the origin to update the world.
In short you would have something similar to this:
I'm very partial to #2.
Also, at this point I'm wondering if the "local area" should move with the player or if I should use the player's own array to update things.
The way I'm seeing it is that what will be drawn on the screen won't be static. Things that are getting out of range will be culled (and unloaded), so I'm wondering if I should add another array (that will be dynamically updated) with its center on the player or project what is visible from the player's position directly on the screen.
For now that's what I'm considering. I am uncertain how Java's memory manipulation could help or hinder. So, that's why I'm asking. What would be, in your opinion, the best way? Or you might have some insight/suggestion, so don't hesitate to throw these my way.
And, if it's not constructive criticism... well... :)
- By PrinceSendai in forum JDBCReplies: 1Last Post: 08-17-2010, 06:42 AM
- By Armadillo in forum JDBCReplies: 3Last Post: 07-30-2010, 05:53 PM
- By mac in forum New To JavaReplies: 2Last Post: 05-26-2010, 02:48 PM
- By Minu in forum Advanced JavaReplies: 1Last Post: 01-06-2009, 07:50 PM
- By kfunk in forum New To JavaReplies: 4Last Post: 10-10-2008, 03:33 AM