I have been working on a litte engine creating a nearly infinite jungle. Most things are split up in classes, so it may be reused for other projects. It also has some panda’s walking around
I have also integrated some other code-snipplets found on the forums, as well as some models from the model-downloads.
The sky renderer is a modified version of the nature-demo shader.
I have also integrated my panda-console (F1).
The plants fade-in is also done using a suggestion on the forums.
Movement:
Forward Left-Mouse
Reverse Right-Mouse
Strafe-Left A
Strafe-Right D
Escape Exit
(More is defined in the cameraControl.py : keybindings)
Thanks to ThomasEgi for helping me optimizing the rendering-performance. I hope i integrated his suggestions correctly.
Download:
look below for actual downloads…
The code is not really cleaned up yet. However maybe somebody can use a part of this little project or has some suggestion how to improve things.
Very cool! Even has a day and night cycle!
Unfortunately I only get 5-8 fps. Lowering the number of tiles speeds things up, but it doesn’t look as pretty as a full jungle .
still very colorful overall… and with the other plants. guess tuning the texture-tones might have some quite nice results.
@hypnos… dont ask me why… your code is running at 8fps on my machine… but the code i wrote while i catted with you in the irc channel runs with 40, same trees same number same visual. … tried changeing your code but i somehow cant make it work.thought its almost identical with the other one.
I have updated the source and the data(thanks ThomasEgi) and uploaded it again. I have found an error in the flattenStrong (in the conversion from .egg to .bam) so it might run faster now.
I have also changed some of the controls, as i integrated some object handling stuff. there is a white cube at the startpoint which can be picked up. However this only works in bound-mouse mode (press space to toggle)
Controls:
WASD Movement
Mouse View
Left-Click Pickup
Left-Release Drop
Space bound-mouse / free-mouse toggle
If you have low FPS try out changing TILES and PLANTMAPSIZE in plants.py. TILES is the number of plantsquares built around the player, PLANTMAPSIZE is the size of each tile. Having a big PLANTMAPSIZE and small number of TILES improves FPS when you stand still. On the other side it slows down when you move around. The viewing distance is about TILES * PLANTMAPSIZE.
Usual values for these variables are:
TILES from 1 to 8
PLANTMAPSIZE from 10 to 50
If anybody wants to integrate new plants into the scene:
In plants.py add a new entry to the dictionary plantmodelDict.
the key is a random name, the items is a list of the following entries:
Number of occurances ( this is relative to the overall number of occurances of all plants )
path to the model (should be an .egg file, they get converted to .bam’s automatically)
minScale (minimal scale of the model in the scene)
maxScale (maximal scale of the model in the scene)
destroySize is currently not in use, just use some number.
New download links:
look below for actual downloads…
edit:
uploaded new data version, it was missing a the box.egg
Okay, I feel dumb. But how do you run the program? I’ve looked at each code file and they all seem to only define classes/functions. Which one do I run?
I have updated the files on the server again. A lot of changes were done on the plant-generation, which possibly make it faster, at least the forest looks denser now.
There is also a new speciality, however it’s only active for the smallest plants. It generates special areas (using the PerlinNoise2) function where some plants grow and other’s dont. It would be possible to have forest-free areas (however fine tuning that takes quite a while so i havent got up to this).
Downloads:
see below for newer versions
the next thing im thinking about is using some level-of-detail to have better graphics.
Wait… Panda has a Perlin noise function? Or you have written one? And you can use it to place different kinds of plants? I could really use that. I will look at your code, thanks.
I have tried your latest version. Very cool to see the open spaces in the forrest! The frame rate is also a bit better. Standing still I now get 20 fps. When I move and new terrain has to be generated it is ~8 fps and can go down to 4fps.
Should i modify some code to get it run? i’ve downloaded the 2 zip file and extracted to 2 folders, in the source folder i typed ppython main.py and see a window but disappeare immediately then i copied contents from data folder to source folder, the result just the same, here is the console output:
D:\PandaMystuff\tda-source-v0.7.1>ppython main.py
Warning: DirectNotify: category ‘Interval’ already exists
DirectStart: Starting the game.
Known pipe types:
wglGraphicsPipe
(3 aux display modules not yet loaded.)
:util(warning): Adjusting global clock’s real time by 0.521589 seconds.
I: pandaInteractiveConsole.init
I: - GUI enabled
I: - Console enabled
D: myInteractiveConsole.init
setting up collision check
:audio(error): createSound(sounds/walking.mp3): File not found.
:gobj(error): Texture::read() - couldn’t read: data/textures/ground/mud-tile.png
:gobj(error): Unable to find texture “data/textures/ground/mud-tile.png” on text
ure_path .;/c/Panda3D-1.3.2/etc/…;/c/Panda3D-1.3.2/etc/…/models or model_path
.;/c/Panda3D-1.3.2/etc/…;/c/Panda3D-1.3.2/etc/…/models
D:\PandaMystuff\tda-source-v0.7.1\source\heightfield.py:52: DeprecationWarning:
integer argument expected, got float
self.mHeightFieldTesselator.setFocalPoint( posX, posY )
Terrain mesh is 0 triangles.
Traceback (most recent call last):
File “main.py”, line 57, in ?
a = the_days_after()
File “main.py”, line 30, in init
self.heightfield = heightfieldClass( self.camCon.globalPosCameraNode )
File “D:\PandaMystuff\tda-source-v0.7.1\source\heightfield.py”, line 9, in i
nit
self.setupHeightfield()
File “D:\PandaMystuff\tda-source-v0.7.1\source\heightfield.py”, line 43, in se
tupHeightfield
self.updateHeightField()
File “D:\PandaMystuff\tda-source-v0.7.1\source\heightfield.py”, line 62, in up
dateHeightField
self.mHeightFieldNode.setTexture( self.tex0, 1 )
TypeError: Arguments must match one of:
set_texture(NodePath * this, Texture * tex)
set_texture(NodePath * this, TextureStage * stage, Texture * tex)
set_texture(NodePath * this, Texture * tex, int priority)
set_texture(NodePath * this, TextureStage * stage, Texture * tex, int priority)
Yes it looks very nice,nice moving sky and overall decent plants and textures, but atm it aint no farcry yet…maybe it approaches farcry1 I dont know as I dont have that game, but farcry2 well maybe not so much…but yeah its def. one of the nicer games using panda for which we are all grateful
I could ponder some improvements for future consideration:
better LOD management maybe, as I have a latest graphics card ( ok not the BEST but a VERY good one at that: 7600 GT nvidia card and its 256mb and pciE ) and im only getting on average about 35 FPS…considering the textures arent’ very high res at all that is abysmal; camera rotates rather slowly which is frustrating though walking in the forest is very smooth; to get fullscreen one has to click LMB then maximize, then LBM again, so maybe a little hint at iniital st artup could make that known ,- that or a menu with options later on in development; I also think while the random placement is nice, that it would be great to more open areas which would give some break on the FPS
thats about it that I can think of offhand from trying it just now…good work indeed and keep it up
But that wasnt really considered as a game. It was basically a graphic test how a jungle might look like and what i could archive with panda in a short time.
In the meantime i have been working on some other projects which are more advanced.
One thing that ppl might be interested in was a project for the museum of Art in Zuerich (Switzerland), called Arttransforming. Where we modelled a room of the museum in 3d, transforming the Pictures of the Artists into Rooms, where visitors of the museum could virtuall walk in. (using panda3d as engine) http://iad.projects.hgkz.ch/arttransforming/personen-projekte/reto-spoerri/