Hi
I'm working on my next game and i got a problem , i don't know how can i add enemy in my game with theirs own health and armour.
Someone can help me,show me the right way, the best way to add this or a simple code ?
Thanks.
Enemy with health , armour ...
-
- Posts: 168
- Joined: Sun Feb 04, 2007 3:30 pm
- Location: France
"Lean C++" can be a 2 word reponse.
Or create a class called "ennemy" which contains IAnimatedMeshSceneNode, int Health and int Armor.
Or create a class called "ennemy" which contains IAnimatedMeshSceneNode, int Health and int Armor.
Last edited by Steel Style on Fri Nov 30, 2007 12:25 pm, edited 1 time in total.
-
- Posts: 54
- Joined: Thu Oct 25, 2007 1:38 pm
- Location: Montreal, Canada
Agent class (Artificial intelligence)
Nothing to do with IRRLICHT engine. Irrlicht is for 3D/2D scene, this is a graphic engine with some bonus. To "manage" player, friend, enemy, all characters in your game, this is an AI (artificial intelligence) issue.
Look for AGENT, steering behavior, path finding engine, physical engine, goal engine, etc. You need to create a base class that is an Agent. After that, your Agent can be any kind of "character" you want with PROPERTIES and METHOD like size, max speed, mass, acceleration, energy, number of life, etc. Method can be like EAT, CHASE, SEEK, ATTACK, DEFENDS, WALK, etc. This is a big issue. If you know C++, you know what is object programming and AGENT is an object with properties and method.
A more ABSTRACT class could me a MovingEntity. You can
create Agent as a derived class of MovingEntity and create other Vehicule class (like car, boat, plane, etc.) as a derived class of MovingEntity.
Big hint..... Read MORE about Artificial Intelligence. Irrlicht will be use only to show your Agent or Vehicule in the 3D scene. Nothing more. In your agent, you can have a Property that is a pointer to a Billboard with position. The Irrlicht Engine, when will Update the Agent, will show the billboard at the good position.
Have fun ! (lots of work to do but very interesting !)
Look for AGENT, steering behavior, path finding engine, physical engine, goal engine, etc. You need to create a base class that is an Agent. After that, your Agent can be any kind of "character" you want with PROPERTIES and METHOD like size, max speed, mass, acceleration, energy, number of life, etc. Method can be like EAT, CHASE, SEEK, ATTACK, DEFENDS, WALK, etc. This is a big issue. If you know C++, you know what is object programming and AGENT is an object with properties and method.
A more ABSTRACT class could me a MovingEntity. You can
create Agent as a derived class of MovingEntity and create other Vehicule class (like car, boat, plane, etc.) as a derived class of MovingEntity.
Big hint..... Read MORE about Artificial Intelligence. Irrlicht will be use only to show your Agent or Vehicule in the 3D scene. Nothing more. In your agent, you can have a Property that is a pointer to a Billboard with position. The Irrlicht Engine, when will Update the Agent, will show the billboard at the good position.
Have fun ! (lots of work to do but very interesting !)
-
- Posts: 54
- Joined: Thu Oct 25, 2007 1:38 pm
- Location: Montreal, Canada
Hummmm !
Sorry for y ou, but if you want to create a 3D video game with some kind of "intelligence", you are now in the MAJOR LEAGUE of software engineering.
There are "billion" of examples and book about Object Oriented Software
and you really need to be strongly familiar with this before "trying" to code software (game). Maybe you can understand easyly how to create one class and some instance of this class but it is far more complicated to create a video game with many instance (agent, trigger, vehicules) with interaction between each one. You NEED to KNOW STL (Standard Template Library) to manipulate bunch of object (instance). You need to understand INHERITANCE, VIRTUAL CLASS and FUNCTION, POLYMORPHISM, etc. STL will help you manipulate LIST, MAP, VECTOR, and so on. You need to control list of agent (or instance), list of drawing and animation items, etc. You can also learn DESIGN PATTERN in C++.
My big guess is that you need to design object oriented software for at least 2 or 3 years before trying to design video game. As I said before, you are in MAJOR LEAGUE without knowing coding OO software !!!
Maybe you can try with some small puzzle game or Card game.
Try finding Object Oriented software around CARD GAME.
It could be a good start. You need to start at the beginning.
Good luck !
There are "billion" of examples and book about Object Oriented Software
and you really need to be strongly familiar with this before "trying" to code software (game). Maybe you can understand easyly how to create one class and some instance of this class but it is far more complicated to create a video game with many instance (agent, trigger, vehicules) with interaction between each one. You NEED to KNOW STL (Standard Template Library) to manipulate bunch of object (instance). You need to understand INHERITANCE, VIRTUAL CLASS and FUNCTION, POLYMORPHISM, etc. STL will help you manipulate LIST, MAP, VECTOR, and so on. You need to control list of agent (or instance), list of drawing and animation items, etc. You can also learn DESIGN PATTERN in C++.
My big guess is that you need to design object oriented software for at least 2 or 3 years before trying to design video game. As I said before, you are in MAJOR LEAGUE without knowing coding OO software !!!
Maybe you can try with some small puzzle game or Card game.
Try finding Object Oriented software around CARD GAME.
It could be a good start. You need to start at the beginning.
Good luck !
-
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
OO isn't necessary, especially as a sole developer. It's perfectly possible to write an entire game in C (or any other non-OO language).
To begin with, find out what a struct is. Once you've familiar with the idea of defining, declaring and using a single object containing multiple types of data, then you can take the next step up, to classes.
To begin with, find out what a struct is. Once you've familiar with the idea of defining, declaring and using a single object containing multiple types of data, then you can take the next step up, to classes.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way