
I am making a large world type game, with some horror elements as well as rpg and survival elements. I recently decided to rewrite what I have so far, because since starting, I have learned much more about jmonkey and performance.
-
I will most likely be using jayfella’s terrain grid system. All the terrain is pre-made in image heightmap files. When a new terrainquad is loaded, I will, in a new thread, grab a text file that corresponds to that cell which will have some information such as game objects to load and entities. When a terrain is unloaded, all the information for that cell will be saved to the text file. If I go this route, how should I handle loading multiple objects? I do not want to load textures or models if they are already in memory (in a different cell or in the same cell). How should I know if one has already been loaded?
-
The player is in its own node, and the dynamic objects such as entities are in their own node, but when a cell is unloaded it will search through the arraylist of entities and file all the ones in that cell and save their info with the text file. Is this a performance friendly way?
-
I want to use the scene graph in the right way. I read a while ago that the bounding boxes of nodes are checked for occlusion. It would be great if I could just have one node for each cell which would hold the terrain, static objects, physics objects, basically everything for that cell in it, but I don’t believe I can do that.
See my picture for visual representation.
I forgot to add:
Pretty much everything in the game has a definition file (items, props, trees that can be cut down, rocks that can be mined, armor, weapons, npcs, enemies). This is what a definition file for a cell could look like, named “(3,7).txt” :
[java]
#gameobjects
tree “objects/oak” 5,7,2
ore “objects/copper” 8,2,8.5
treestump “objects/generictreestump” 6,5,7
#entities
entity “entities/scorpion1” 9,2,5
[/java]
(the numbers are coordinates)
Of course it would have more. The first section are objects that the player can interact with (cut down, mine). The second section are objects that have ai, and are updated at each frame. Of course the player can interact with these as well. I would also have a section for thing such as grass that are not interactive.
This is a monster topic in terms of my questions, sorry everyone. If it needs more explanation I can give that.
@8Keep123 said:
...
I am making a large world type game, with some horror elements as well as rpg and survival elements. I recently decided to rewrite what I have so far, because since starting, I have learned much more about jmonkey and performance.
You do realize that is the exact reason that people never finish games?

Taken from this article: Make Games - Finishing a Game
1 Like
I know. But this is the first complex gane I am attempting, and its not a complete rewrite. Basically im just re-organizing my code. Moving stuff around and changing some stuff related to the scene graph to get better performance.
anyone have any suggestions?