Can i create a virtual city using Irrlicht?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
sinister07
Posts: 2
Joined: Sun Mar 21, 2010 6:20 pm

Can i create a virtual city using Irrlicht?

Post by sinister07 »

Hello Everybody,

I need to do a project which requires a tour in a virtual city.
just like in GTA, but without all the guns, moving people or cars... frankly, only empty streets and Buildings should be enough.
Only demand is to create a big enough map that can simulate a walking person for about 30 minutes (if possible, without loading as it's done in games when reaching a certain door)

Can i use this engine to do so? If so, where do i start? (I have no prior knowledge in 3D programming). If not, could you advise me about additional tools?

thanks,
Max
DtD
Posts: 264
Joined: Mon Aug 11, 2008 7:05 am
Location: Kansas
Contact:

Post by DtD »

The way GTA4 does it is stream the city as you move, so if you're moving down a street it loads everything a mile in front of you, and stuff like that. It is rather complicated by still very do-able!

~David
Seven
Posts: 1034
Joined: Mon Nov 14, 2005 2:03 pm

Re: Can i create a virtual city using Irrlicht?

Post by Seven »

sinister07 wrote:(I have no prior knowledge in 3D programming)
sinister07
Posts: 2
Joined: Sun Mar 21, 2010 6:20 pm

Post by sinister07 »

thank you David for your fast reply.

So what tools are u suggesting which may make it easier for me to accomplish this job? The tools/engines must be open source...

Maxim
freetimecoder
Posts: 226
Joined: Fri Aug 22, 2008 8:50 pm
Contact:

Post by freetimecoder »

Textures: Gimp
Models: Blender
Programming: Irrlicht ;)

Requires alot of practice though.

greetings
ent1ty
Competition winner
Posts: 1106
Joined: Sun Nov 08, 2009 11:09 am

Post by ent1ty »

DtD wrote:The way GTA4 does it is stream the city as you move, so if you're moving down a street it loads everything a mile in front of you, and stuff like that. It is rather complicated by still very do-able!

~David
I was always wondering, how to do such a thing in irrlicht. I mean, i could set nodes which are farer than lets say, 1000 metres, invisible, but how to load them on real time, given that my entire level is saved as .irr file?
irrRenderer 1.0
Height2Normal v. 2.1 - convert height maps to normal maps

Step back! I have a void pointer, and I'm not afraid to use it!
arras
Posts: 1622
Joined: Mon Apr 05, 2004 8:35 am
Location: Slovakia
Contact:

Post by arras »

You can't do that with one scene from one file. You need to split that scene in to "blocks" (files) then load/discard blocks depending on your position.
DtD
Posts: 264
Joined: Mon Aug 11, 2008 7:05 am
Location: Kansas
Contact:

Post by DtD »

Oops, I missed the new to 3D programming bit. You're going to start with something simpler than something like this. AFAIK there is no "set it up and go" open-source (or otherwise) solution to something like this. Generally your entire game has to be designed around the basis of stream loading. It won't be as simple as using irr files or basic Irrlicht scene nodes, you'll for sure have to make your own scene node (or even your own scene graph and just use Irrlicht purely for rendering.)

Another way to do it (Which is what GTA: Vice City did afaik) is have "clever" loading screens. In VC they just had whole islands be one level, and as you cross the bridges from one island to the next it showed a full screen "Welcome to Blah Blah Island Thing" which was really it loading the level.

~David
digoxy
Posts: 51
Joined: Wed Feb 17, 2010 3:55 pm
Location: Currently Germany.

Post by digoxy »

arras, your tiled terrain uses a bit of this concept. And, a study of bit's grass node would put all this together in a nice little package. Tell me if I am wrong but if using the methods from bitplanes grass node, one should be able to put a bit of work into that and have it load objects (buildings, streets etc).

sinister07, if you planning to do this with IrrLicht and you have no knowledge of 3d Programming, it will take a while to get up to speed. I have been on this for a few months now and still get stumped on some very simple things! :)

The concept of loading and unloading (streaming) seems to be a subject that comes up all over the place when people talk about a 3D world. I have yet to see anyone post anything that allows a cut and paste of something like this, it surely would be nice.

Right now, I would like to see arras or bitplane combine the tiled terrain and grassnode, these two running together would be awesome.

sinister07, I wish you the best of luck, and, as new as I am, please let me know if there is anything I can help you with. I have run through many issues over the past few months and probably already know your hurdles.

Take a look at the tutorials and see if they look like something you could do on your own, or, with a bit of practice, if so, get started. The list above (the tools list) isnt bad either!

Good Luck,
digz..
Grandma-- / Grandpa --
arras
Posts: 1622
Joined: Mon Apr 05, 2004 8:35 am
Location: Slovakia
Contact:

Post by arras »

digoxy wrote:arras, your tiled terrain uses a bit of this concept. And, a study of bit's grass node would put all this together in a nice little package. Tell me if I am wrong but if using the methods from bitplanes grass node, one should be able to put a bit of work into that and have it load objects (buildings, streets etc).
Well, ...not really, although it may seem like. My terrain does not load from file and does not split data in to parts. In fact whole terrain data is stored in memory in one block. Its only graphic (vertices, textures, colours) which is updated during run time. But there is some similarity in concept in that "something" is updated "somehow" based on position of camera (in my case tiles of terrain).

How grass node of bitplane works I don't know. I saw few screenshots and discussion but I have newer used it, much less looked in to sources. So I have no idea how it works.

Loading/discarding scenes in a way we discus here is not that difficult in fact. You don't need special scene node to do that, just very simple manager which keeps track of camera or player position and loads/discards blocks of scene. You would need simple 2D array with filenames and that's all.

What is difficult however is to do that in a fluid and smooth way without significant drop in FPS and visible "cuts".
digoxy
Posts: 51
Joined: Wed Feb 17, 2010 3:55 pm
Location: Currently Germany.

Post by digoxy »

Someday, I too will be able to say something like that is easy. :)

I will get your Tiled Terrain working with bits grass sometime, its a bit over my head, but its good for the learning part.

Would like to see some simple code on how to load and unload objects based on cam position. It just seems that this concept of loading and unloading scene data (including the terrain of course) is something to play with. I dont think I am alone when I say that.

To have a full scale city, to move from one end to the other like this discussion talks about would take a complete rotation of all nodes, terrain etc. I can do the simple stuff like with weather, rain or hail etc but there is so much information when you throw in a bunch more objects.
Grandma-- / Grandpa --
arras
Posts: 1622
Joined: Mon Apr 05, 2004 8:35 am
Location: Slovakia
Contact:

Post by arras »

If we speak about Irr scenes created in IrrEdit then you just load/discard whole scene. Of course you need to create that scenes in some regular grid (like city blocks for example). Then let say you load and render block in which player is positioned and blocks around. Once player changes position in to another block, one row of blocks is discarded and new one is loaded.

If however you do not use presaved scenes like those in irr, you need to create your own system of storing data. It might be some configuration txt or xml file. Depending of what your blocks of scene consist of it sure can be more complicated (geometry, visual effects, lights, AI, NPCs and so on)
xirtamatrix
Posts: 219
Joined: Fri Feb 19, 2010 4:03 pm
Location: Estonia

Post by xirtamatrix »

Quite true, I've been doing some research into the theoretical aspects of achieving this using a grid system. If you think of maps(scenes) as "tiles" then a max of 9 maps (a 3x3 grid) is all what needs to be loaded at any one time, i.e. the map the user(camera) is in, plus 8 on all 8 sides, this is necessary to keep the illusion of "seamless" world.

If the maps in question are not of too large size, this should be easily do-able. A further optimization can be achieved by loading only the static geometry of the 8 surrounding maps, and all else only for the "current map". Moreover, if this loading can be done in a seperate thread then the user should, theoretically, not even feel something is being loaded/unloaded.

I'm not at the level in Irrlicht to do this atm, but... if no one else gets around to it, I'd surely give it a shot some day :)

cheers!
to live, is natural; to die, is not!
Post Reply