Retro World v.1.0

Just finished the first basic prototype of my future game, and i thought better share it now than later.

I’m quite happy with the results after learning panda+python for one month.

You can download the source code and required media here:

some screenshots of the project:

Aldought i feel just beggining on this and the code may be a bit naive, i think everything is more or less organized
and easy to read and understand.

Anyone who feels about commenting, helping, improving, adding something, welcome!


Looks cool, and looks like it’s only to get cooler :slight_smile:
A few suggestions:

  • Fog and sky
  • An extra octave for the terrain texturing, so it doesn’t look so ‘patterish’
  • Something like a water plane
  • Smoother terrain
  • Baked ambient occlusion-map for terrain

Other than that, I think you’ve done a very good job :wink:

PS. Palm trees, pine trees and swamp-like-trees on one island? :slight_smile:

Thanks for the comments :slight_smile:

[i]- Fog and sky

  • Something like a water plane[/i]

yeah, still thinking on that, the point is the terrain gen algorythm still dont makes perfect islands, so the map in fact is a obvious square, i’ll implement sky and water once this is fixed

- Smoother terrain

also thinking on that, now the map is just 65x65 nodes, probably i’ll change to 129x129 very soon. in fact, the blocky aspect is made on purpose, to give a retro aspect, and to make many plain areas for not getting dizzy like happens to me in many 3d games, if you dissable de ‘retro’ parameter in the terrain class, the map changes to normal slopes.

- An extra octave for the terrain texturing, so it doesn’t look so ‘patterish’

wow, believe me if i tell you still don’t know what an ‘octave’ is outside the music world :wink:

- Baked ambient occlusion-map for terrain

yes, that would be nice, but since the terrain is totally procedurall generated (and that’s a point that wont change i think cause i want infinite parametrical scenarios) i have still to invent a way of making all that also in a procedural way… ufff

PS. Palm trees, pine trees and swamp-like-trees on one island? Smile

hahaha well, i really have to open one day some modelling program and go through one or two tutorials :smiley:

thanks again for all the advice during these days, still have a question or two, for example:

i managed to implement a bilinear interpolation function but when the model is over a tile wich has 3 vertices on the same elevation and just one over or below it doesn`t work right, cause of course the 2 triangles are not aligned equal… any idea how i can fix that?

This is for setting the height of objects on the terrain I assume? The easiest way is probably to switch from using a square interpolation function and just look at the triangle directly under the character. Easy enough, since there are only two for each terrain square. Then calculate the intersection of a vertical line through your object and plane intersecting that triangle.

This should work if all squares are broken up into triangles in the same direction. If you you can probably determine the direction of the internal edge based on which vertex is different than the others (at least for you type of map which just alternates flat areas with steep steps).

mhmm that sounds smart, i’ll give it a try…
unfortunatelly i’m not so shure the terrain is going to keep this way in the future -flat areas with steep steps-.

Thanks for the tip arkaein

Nice effect. I love the retro trick for the water :wink:

A feeling like in doom/heretic engine that use raytracing drawing.

the water has color vertices + texture
the ground only texture, well, has color, but black everywhere.

Wont run:

Any ideas?
Edit: Guess its the wrong panda version?

Yeah, your Panda3D version is horribly outdated. Grab a newer one from the download page.

Hehe, I havent noticed that I still had 1.4.2 installed on my laptop! =)

Anyway, how do I change the retro terrain mode? When overlooking and a few tests I couldnt come up how to not use the retro terrain…

i am a little new to panda3d. I wanted to know how is the pathfinding done??
coz i can see ralph moving quite intelligently without bumping on any object.
how is this done? any special algorithm like Astar used?


yes, that’s it, i managed to implement some astar code, some of them i found it on the net and it works quite well

if you download the retroworld source code you can find that most part of the astar code is located in the class

everything is very simple, the whole world is a grid of squared cells, you click on one of them and generate a path of nodes using astar algorythm

every character has his own array of points so they can move at the same time, aldough this is not intended to be a real time process yet

after 6 months of more of being apart from wonderfull python i can’t wait on moving to Tokyo on February and continuing this experiment :slight_smile:


i found the astar thing i wrote is based on “Mavasher’s implemenation for panda of the astar pygame example”, and i think i found that somewhere in this forum

uv done nice work i must say.
thanks :smiley:

thanks! always nice to hear that.
i hope soon i can begin to implement some rpg game mechanics on it, we’ll see

sorry to bother you again. the thing is that i have to implement Astar on a static map(my terrain is an egg file). how will i represent the grid?

well, in fact terrain and grid are diferent things:

terrain: this is geometry that conforms a model, you made a model and i generated it procedurally

grid: this is an bidimensional array wich holds an abstract/imaginary grid of cells

also there’s the module that manages the interaction of mouse and terrain, basically, detects the mouse click in some point on the terrain and translate it to grid coordinates

from there, all xz calculations are based on this imaginary grid, so the character walks from one cell to the other, while a kind of getElevation function calculates de y position over the terrain

what you should do, the easy way, reusing the structure of the code:

1.get shure that your egg model accepts collisions well

2.modify the module to load your egg model (reference it to self.root var) instead of generating a random one

i hope you understand that, feel free to ask if you are in doubt
i’m quite busy today but i can answer you in incoming days

good luck!

if i am using a model as map, hw will the grid be created? where must i store the data like terrain cost? im quite confused about that. please help

-=Never mind, I was being an idiot=-

this looks really nice. How much experience do you have with programming? Is python your first language?