Some question from a beginner

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.
Kalash
Posts: 11
Joined: Fri Nov 02, 2007 10:58 pm

Some question from a beginner

Post by Kalash »

Ok, I started a game project and I chose Irrlicht for 3D.

I have some questions because its the first time I'm using such a tool.

My project is a small mmorpg, wow like project.

1. How should I manage collision between players or NPC and world? Do I need a physic engine? The collision must be managed by the server. (to avoid cheat etc)

(I tried some examples from irrlicht and code snippets from the forum but I always have some problemes, and when is done the calculs of the physics cause I don't want to display anything on the server!)

2. In which format do I have to create my World. Does it have to be in one file, severals...? I want something like a terrain and elements like houses etc

3. I forgot the other questions :S

I'll ask them latter, here are the principal, thanks in advance!
Saturn
Posts: 418
Joined: Mon Sep 25, 2006 5:58 pm

Post by Saturn »

Start with 3d- pong, astroid, space invaders, pacman, etc.
MasterGod
Posts: 2061
Joined: Fri May 25, 2007 8:06 pm
Location: Israel
Contact:

Post by MasterGod »

Another one.. omg..

Well, You can find all the answers you seek by searching and maybe some can be found in The Irrlicht Beginners Manual Manual, check my sig.
Image
Dev State: Abandoned (For now..)
Requirements Analysis Doc: ~87%
UML: ~0.5%
Kalash
Posts: 11
Joined: Fri Nov 02, 2007 10:58 pm

Post by Kalash »

Saturn wrote:Start with 3d- pong, astroid, space invaders, pacman, etc.
I have already created a terrain.x using blender and Im able to move a basic player on the world but it's not very sophisticated and I try to improve it here.
MasterGod wrote:Another one.. omg..

Well, You can find all the answers you seek by searching and maybe some can be found in The Irrlicht Beginners Manual Manual, check my sig.
This wiki is really empty and there is no answer to my questions...

If I'm asking for some help it's principaly because in each example the code is different and is supposed to do the same thing. Some example use Q3 things and I don't want to manage Q3 maps etc...

Thanks
shogun
Posts: 162
Joined: Wed Sep 05, 2007 11:02 am
Location: inside

Re: Some question from a beginner

Post by shogun »

Kalash wrote:My project is a small mmorpg, wow like project.
No, it isn't. World of Warcraft was created consuming more man years you can probably imagine - like most other MMORPGs, BTW. Even the "small" ones. I'm sure you're underestimating the amount of work here.

Really, try something smaller at first. You have a pretty 3d engine at hand, and all you can think of is "wow like"? How about some interesting gameplay? MMORPGs are content, mainly. I don't even think that the engine will be the really hard part (making it a *good* MMORPG engine is another thing ...), but the content will be. If you don't have at least three to five very motivated artists (3D and 2D) working for you, your MMORPG will be just some boring techdemo. If it's that what you want, why not spicing things up with more gameplay? And less MMO?
Kalash
Posts: 11
Joined: Fri Nov 02, 2007 10:58 pm

Re: Some question from a beginner

Post by Kalash »

shogun wrote:
Kalash wrote:My project is a small mmorpg, wow like project.
No, it isn't. World of Warcraft was created consuming more man years you can probably imagine - like most other MMORPGs, BTW. Even the "small" ones. I'm sure you're underestimating the amount of work here.

Really, try something smaller at first. You have a pretty 3d engine at hand, and all you can think of is "wow like"? How about some interesting gameplay? MMORPGs are content, mainly. I don't even think that the engine will be the really hard part (making it a *good* MMORPG engine is another thing ...), but the content will be. If you don't have at least three to five very motivated artists (3D and 2D) working for you, your MMORPG will be just some boring techdemo. If it's that what you want, why not spicing things up with more gameplay? And less MMO?
Useless... I don't need this kind of answer, we are not here to talk about all quests, 3D models etc, did you read my questions? I don't want to get answer about content, but about the irrlicht engine...
dlangdev
Posts: 1324
Joined: Tue Aug 07, 2007 7:28 pm
Location: Beaverton OR
Contact:

Re: Some question from a beginner

Post by dlangdev »

Kalash wrote:Ok, I started a game project and I chose Irrlicht for 3D.

I have some questions because its the first time I'm using such a tool.

My project is a small mmorpg, wow like project.
that's the spirit, dream big my friend, that's the way it should be.

let me know if you have a dev server, i'd like to join. saves me money. i'm just an ordinary cheap salaryman with not much money to brag about. ;-)
Kalash wrote: 1. How should I manage collision between players or NPC and world? Do I need a physic engine? The collision must be managed by the server. (to avoid cheat etc)

(I tried some examples from irrlicht and code snippets from the forum but I always have some problemes, and when is done the calculs of the physics cause I don't want to display anything on the server!)
having a physics engine is the way to go. you could try bullet first.
Kalash wrote:
2. In which format do I have to create my World. Does it have to be in one file, severals...? I want something like a terrain and elements like houses etc
use blender to create meshes and materials, import them in irredit, then load the irr scene files later in your game app later.
Kalash wrote:

3. I forgot the other questions :S

I'll ask them latter, here are the principal, thanks in advance!
keep 'em coming. i'll send the bill later.
Image
Broodingspark
Posts: 8
Joined: Sun Dec 30, 2007 12:26 am

Post by Broodingspark »

"1. How should I manage collision between players or NPC and world? Do I need a physic engine? The collision must be managed by the server. (to avoid cheat etc)"

I would suggest that you not implement physics on the server, but restrain that to a simplified form of wall collision (your server ideally shouldn't be using Irrlicht anyway, so there are plenty of approximations you can use). As long as your players cannot walk through walls, they can't really cheat much. For player characters colliding with each other and trivial obstacles, yes, you will need some form of collision of physics engine for the client. (worst case a cheater can walk through people, so there's not much to gain, and you save on server processing power).


"2. In which format do I have to create my World. Does it have to be in one file, severals...? I want something like a terrain and elements like houses etc"

Depends. You could just use some sort of level format like the Quake levels, and then have frequent zoning points where you move players into different levels.
Virion
Competition winner
Posts: 2148
Joined: Mon Dec 18, 2006 5:04 am

Post by Virion »

1. How should I manage collision between players or NPC and world? Do I need a physic engine? The collision must be managed by the server. (to avoid cheat etc)
Complex calculations shouldn't be done on server, especially "wow-like" mmo. Or you can just try it out, and you will know why. :P
2. In which format do I have to create my World. Does it have to be in one file, severals...? I want something like a terrain and elements like houses etc
Up to you.

By the way, from the questions you'd asked (especially no.2), I reckon you never done a 3D game before?
Kalash
Posts: 11
Joined: Fri Nov 02, 2007 10:58 pm

Post by Kalash »

@dlangdev : Thanks a lot for your help, at the moment, It's only a small project to test irrlicht and check if it could be used for a medium project, I'm not yet recruiting devs :) Anyway, if you are interested in server side application and network transfer, I have already wrote a network framework (tcp/ip is working, i'll finished udp later)

Then, to you, I should use bullet for physic interraction? client side, I suppose?

I'll take a look for irrEdit, thank you.

@Broodingspark : I think I wont implement a collision between players but only between players and world. How do you think I could manage NPCs position (server side) and respect the world constraints? (wall, Ypos...)

Thank you!

@Virion : Indeed, it's my first 3D application :)
I agree with you, I shouldn't use a physic engine on the server, but I can't see how to check NCP's and player's position. I could use bullet on client side and do a small server side check, but NPCs are moved only by the server.

Are you sure I shouldn't use irrlicht on server side?
I tried a simple collision test with irrlicht :

Code: Select all

    const core::aabbox3d<f32>& box = m_player->getNode()->getBoundingBox();
    core::vector3df radius = box.MaxEdge - box.getCenter();
    scene::ISceneNodeAnimatorCollisionResponse *collider2 = m_smgr->createCollisionResponseAnimator(
        collision, m_player->getNode(), radius, core::vector3df(0, -1, 0),
        core::vector3df(0, 0, 0));
    m_player->getNode()->addAnimator(collider2);
    collider2->drop();
But sometimes, the "player" moves oddly.
Here is the bin example: http://www.megaupload.com/fr/?d=ZBGLXMFZ
Try to walk near the white meshes, the "player" will get stuck.
Could it be a way to move NPCs from the server?

Thank you again for your help.[/code]
dlangdev
Posts: 1324
Joined: Tue Aug 07, 2007 7:28 pm
Location: Beaverton OR
Contact:

Post by dlangdev »

you can start with any physics module, the decision is entirely up to you, though. my project is simply a collection of demos, not a real running program. my aim is to learn the bits-n-pieces first before making a cutie-pie game. i have not chosen a physics module, yet though i'm leaning on bullet at the moment.

so far, i got the network running on raknet code pretty much halfway done, the other half will involve some interaction with dead reckoning and physics. it could turn pretty messy later. most of it will be client-based.

i won't even try putting all the grunt-work on the server as i can only afford the cheapest server out there, typical roach-server package is my type-of-deal. in this design, old rusty client machines will always lag behind the faster recently bought quad-core sli-board top-o-the-line graphics machines.

keeping all the action on the client will free my server of the precious cpu-cycles, i have to design it so that the client is doing most of the computations. the server is basically doing the passing and synchronizing of events.

goodluck on your project, hope to see some screenshots soon.
Last edited by dlangdev on Mon Dec 31, 2007 5:17 am, edited 1 time in total.
Image
Broodingspark
Posts: 8
Joined: Sun Dec 30, 2007 12:26 am

Post by Broodingspark »

"How do you think I could manage NPCs position (server side) and respect the world constraints? (wall, Ypos...)"

I would set up as a two dimensional binary collision array, personally.

"I could use bullet on client side and do a small server side check, but NPCs are moved only by the server."

Before moving an NPC, just check to see that the coordinate block (say, square meter for game purposes) that they're moving into is a 0 and not a 1.

"Are you sure I shouldn't use irrlicht on server side?"

Yes, quite sure. Irrlicht is a 3d rendering engine, and you do not need to render 3d graphics of any kind of the server. All you need to do is basic 2d math- irrlicht won't help you there. You should be building this like a 2d game without graphics on the server. Just checking X Y locations of things, and executing basis script and pathfinding, and maybe a bit of AI.

If you were making something like a 3d platformer, then you might need some 3d math on the server, but the best advice I can give is to simplify things to 2d on the server. The only 3d you should have for a game like this is the client side display.
Kalash
Posts: 11
Joined: Fri Nov 02, 2007 10:58 pm

Post by Kalash »

Ok thank you a lot, now I have to work on it.

Screenshots are coming... not soon :D
Kalash
Posts: 11
Joined: Fri Nov 02, 2007 10:58 pm

Post by Kalash »

Ok, I still have a question. I started the server part but I included it on client side to show the 3D render. I'm not using irrlicht in this part of code.
Each NPC have a (x y z) position. How can I load a map (without irrlicht!)?
Do I have to store all triangles for each mesh (map, NPC...) and check each time if they are colliding or not?
And how to check if there are collision using the stored datas?

Code: Select all

Before moving an NPC, just check to see that the coordinate block (say, square meter for game purposes) that they're moving into is a 0 and not a 1.
I can't see how to implement this trick!

Best Regards.
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Re: Some question from a beginner

Post by rogerborg »

Kalash wrote:My project is a small mmorpg, wow like project.
A "small [Massive]" game? JUMBO SHRIMP.
Kalash wrote:1. How should I manage collision between players or NPC and world?
As simply as possible. Use sphere and box collision primitives where possible, and avoid doing triangle based collisions (including slope checks). Where you do need to do triangle checking, try to use a heightfield or other regular organisation where you can quickly determine the appropriate triangle(s) to check. Remember that your collision geometry doesn't have to be the same as your rendering geometry.

Also, for any large world, you'll run into an O(n^2) problem if you just naively check every actor against every other actor. Instead, consider ordering them by (e.g.) X or Z coordinate, and only check each actor against actors near to it in the ordered list.

Kalash wrote:Do I need a physic engine?
Unlikely.

Kalash wrote:The collision must be managed by the server. (to avoid cheat etc)
It depends if you expect anyone to actually play your game. I suspect the question is moot, but in principle, it's a choice that only you can make. You could assume that every client is a filthy cheating robot, and therefore only accept requests from clients, never world state changes. Alternatively, you can go the Diablo/WOW way and put a degree of trust in the clients. This appears to offload the work, but then you have to consider whether you need to do work on the server to catch (e.g.) speed/teleport hacks. It's your game, and your decision.

Kalash wrote:2. In which format do I have to create my World. Does it have to be in one file, severals...? I want something like a terrain and elements like houses etc
"have to"? You don't "have to" create it in any particular way. It's your game, and your decision. You may find that a heightfield-based terrain with meshes on top of it is appropriate for a predominantly outdoors game, or you might end up going for a completely mesh-based solution if you have a lot of dungeons. Remember that your collision geometry doesn't have to be the same as your render geometry.

I'll give you the same advice that I give every other person who thinks that they can write a "small massive" game:

1) Join an existing project. Try Worldforge.

2) Write a text based MUD first. That covers about 75% of the work needed to write a 3D MORPG, and if you can't do that, then you're wasting your time messing around with 3d geometry.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Post Reply