Game Programming and Development Tools

Ninja Robot Attack – steveth45

steveth45

Member

Posts: 536
From: Eugene, OR, USA
Registered: 08-10-2005
I made a simple first person shooter with the Irrlicht 3D game engine. You can download it from my webpage: http://steveth45.net/ I will be using the source code to teach a simple intro to 3D game programming workshop at the Christian Game Developers Conference in May.

It's not that complicated of a game, but the idea is to show how easy it is to make 3D games with Irrlicht in C++.

------------------
+---------+
|steveth45|
+---------+

CPUFreak91

Member

Posts: 2337
From:
Registered: 02-01-2005
Looks nice. I'm itching to download it soon. Is it for windows only?

------------------
All Your Base Are Belong To Us!!! chown -r us ./base
"After three days without programming, life becomes meaningless.'' -- Tao of Programming Book 2

steveth45

Member

Posts: 536
From: Eugene, OR, USA
Registered: 08-10-2005
Yeah, sorry,
For the time being, I only have a Windows binary. I've been a long-time linux fan and user, but I haven't used it since I got my laptop because of lack of adequate wireless drivers in linux. I'm planning on getting linux running again on the laptop (it's already set up for dual-boot) and building a linux binary. As far as OSX goes, I'm looking for a decent G4 or G5 based Mac with at least OS 10.4 on it (and a decent video card) to build and test Mac binaries for my games. However, I am in a tight place financially, so I can't afford it.
The upshot is that I will be releasing the source code shortly, so people can build their own binaries or even change the source to make the game (more) fun.
CPUFreak, I see that you are a loyal linuxer. I have much respect for that. My goal is that any game I create be available for download for Linux, Windows, and Mac.
Stay tuned.

------------------
+---------+
|steveth45|
+---------+

HanClinto

Administrator

Posts: 1828
From: Indiana
Registered: 10-11-2004
Hey, Steve! Looks great! I downloaded it last night, but it looks like I'm missing a DirectX dll of some sort or another, so I'll have to track that down before it'll run for me.

I look forward to trying it out! I'll keep you posted when I do.

Cheers!

--clint

CPUFreak91

Member

Posts: 2337
From:
Registered: 02-01-2005
quote:
Originally posted by steveth45:
CPUFreak, I see that you are a loyal linuxer. I have much respect for that.

quote:
My goal is that any game I create be available for download for Linux, Windows, and Mac.
Stay tuned.


Same here.

------------------
All Your Base Are Belong To Us!!! chown -r us ./base
"After three days without programming, life becomes meaningless.'' -- Tao of Programming Book 2

crazyishone

Member

Posts: 1685
From:
Registered: 08-25-2004
Hmm, it didnt work for me. When i tried to run the executable i got an error that the application wasnt configured correctly. :-/

------------------
"I bleed black tears"

Will the emo kids be my friends now?

buddboy

Member

Posts: 2220
From: New Albany, Indiana, U.S.
Registered: 10-08-2004
hey i have a question... if you have an engine like this, do you have to have the DirectX SDK to use DirectX with it? or is it not required?

------------------
In the stock market, you must buy high and sell low...Wait! That's not right!
--------------
Yes, I can be intelligent at times!!

steveth45

Member

Posts: 536
From: Eugene, OR, USA
Registered: 08-10-2005
HanClinto & Crazyishone, I think the current game build is set to use DirectX 9.0c . So, you have to get the latest DirectX runtime/drivers from http://www.microsoft.com/windows/directx/ to run it. I'm at work right now, but I can put up an OpenGL version for Windows in a couple hours.

Buddboy, you can exclusively use OpenGL in Windows which makes the DirectX SDK unnecessary ( I think ) . Otherwise, you have to have the SDK to do builds. Irrlicht engine allows you to use either one.

CPUFreak, I am going to try to install linux tonight and maybe have a build of the game ready in the next few days. I don't know how much work, yet, is needed to get things running. Irrlicht & Audiere libraries are both supposed to be easily cross-compatible but sometimes there are hoops you have to jump through to get things to compile.

------------------
+---------+
|steveth45|
+---------+

steveth45

Member

Posts: 536
From: Eugene, OR, USA
Registered: 08-10-2005
OK, I recompiled it for OpenGL. The Irrlicht.dll that is included is different from the other one, so don't switch them around. Let me know if it works for you. http://steveth45.net/blog/

------------------
+---------+
|steveth45|
+---------+

buddboy

Member

Posts: 2220
From: New Albany, Indiana, U.S.
Registered: 10-08-2004
ok...

------------------
In the stock market, you must buy high and sell low...Wait! That's not right!
--------------
Yes, I can be intelligent at times!!

dartsman

Member

Posts: 484
From: Queensland, Australia
Registered: 03-16-2006
Looking good. I looked into the Irrlicht engine a while back too, was pretty good for getting things up and running quickly.

Lol, I remember a tutorial that showed how you could load up a BSP level and then tell the camera to have collision detection with the level in like 6-8 lines of code.

Good work.

------------------
"But it is God who judges: He brings one down, he exalts another." - Psalm 76:7

Startup Christian Games Company Producing Mobile/PC Games/Tools

HanClinto

Administrator

Posts: 1828
From: Indiana
Registered: 10-11-2004
Hey, Steve!

I downloaded the OpenGL version and I get an access violation when I try and fire the gun. I was able to run around and dodge ninjas though -- looks good!

--clint

steveth45

Member

Posts: 536
From: Eugene, OR, USA
Registered: 08-10-2005
hmmm... access violation? I wonder why.
Do the other sound effects work?

------------------
+---------+
|steveth45|
+---------+

buddboy

Member

Posts: 2220
From: New Albany, Indiana, U.S.
Registered: 10-08-2004
hmm... that's weird... lol...

------------------
In the stock market, you must buy high and sell low...Wait! That's not right!
--------------
Yes, I can be intelligent at times!!

steveth45

Member

Posts: 536
From: Eugene, OR, USA
Registered: 08-10-2005
Two fixes are available on the webpage.

HanClinto, the access violation problem with the gun sound should be fixed. I wasn't checking if there was a problem loading the gun sound. I still don't know why it was unable to load the sound file. I'm using the Audiere sound library, that's why there is the audiere.dll file.

I also posted vcredist_x86.exe which is probably necessary to run the game if you don't already have Visual C++ Express 2005 installed. If that doesn't work, you may have to use Microsoft Update to update your IE and Microsoft Installer first. This should fix the "Application not configured" error. If it doesn't, let me know.

------------------
+---------+
|steveth45|
+---------+

buddboy

Member

Posts: 2220
From: New Albany, Indiana, U.S.
Registered: 10-08-2004
downloaded it... it's kinda slow... maybe it's my pc.. but it lags a lot lol... kinda hard too...

------------------
In the stock market, you must buy high and sell low...Wait! That's not right!
--------------
Yes, I can be intelligent at times!!

dartsman

Member

Posts: 484
From: Queensland, Australia
Registered: 03-16-2006
Good game, could do with a better way of exiting... Alt-F4 is good, but Escape would be better. The following link should help you...

http://www.blitzbasic.com/Community/posts.php?topic=46486

------------------
"But it is God who judges: He brings one down, he exalts another." - Psalm 76:7

Startup Christian Games Company Producing Mobile/PC Games/Tools

HanClinto

Administrator

Posts: 1828
From: Indiana
Registered: 10-11-2004
Awesome, thanks for updating it, Steve! I'll check it out when I get some more free time.

--clint

Edit: BTW, love the new avatar. That's so ultimate power.

[This message has been edited by HanClinto (edited March 27, 2006).]

steveth45

Member

Posts: 536
From: Eugene, OR, USA
Registered: 08-10-2005
I _suppose_ I could make the escape key valid for exiting. I tried to use as much of the engine's default behavior and capabilities to keep the source code as short as possible. It will be trivial to implement since I have my own EventReceiver in the game code to capture mouse clicks and F5 (to restart after game-over). Unfortunately, I'm at work, so I'll have to wait to get home to do it. I think I may add an option to disable the "snow" particle effect as it is alpha-blended and may cause the game to slow down on older video cards. Maybe that will make it run a little faster on Buddboy's system.

------------------
+---------+
|steveth45|
+---------+

buddboy

Member

Posts: 2220
From: New Albany, Indiana, U.S.
Registered: 10-08-2004
that would be good... so it's just me that has the slowdown? lol... i may try it on my Athlon later to see how good it is when it runs faster...

------------------
In the stock market, you must buy high and sell low...Wait! That's not right!
--------------
Yes, I can be intelligent at times!!

dartsman

Member

Posts: 484
From: Queensland, Australia
Registered: 03-16-2006
another way to escape when the ESCAPE key is pressed is that you should have a game loop..

while(true)
{
// update (logic)
// render
}

then just check if the ESCAPE key was pressed and then break...

while(true)
{
if(GetKey(ESCAPE))
break;

// update (logic)
// render
}

I haven't really looked into Irrlicht recently so I don't know how to exactly do so... but if that'd work the you only need an extra 2 lines.

------------------
"But it is God who judges: He brings one down, he exalts another." - Psalm 76:7

Startup Christian Games Company Producing Mobile/PC Games/Tools

steveth45

Member

Posts: 536
From: Eugene, OR, USA
Registered: 08-10-2005
OK, I put up a new version, 0.5. It's got the escape key exit as well as the -nosnow option which turns off the snow effect. Buddboy, just run the game "NinjaRobotAttack -nosnow" from the prompt and it should run a little smoother for you.

------------------
+---------+
|steveth45|
+---------+

buddboy

Member

Posts: 2220
From: New Albany, Indiana, U.S.
Registered: 10-08-2004
which prompt?

------------------
In the stock market, you must buy high and sell low...Wait! That's not right!
--------------
Yes, I can be intelligent at times!!

dartsman

Member

Posts: 484
From: Queensland, Australia
Registered: 03-16-2006
hahaha...

which prompt... lol...

------------------
"But it is God who judges: He brings one down, he exalts another." - Psalm 75:7

Startup Christian Games Company Producing Mobile/PC Games/Tools

HanClinto

Administrator

Posts: 1828
From: Indiana
Registered: 10-11-2004
Buddboy: The command prompt, it's also called the "shell prompt", or sometimes just "the shell". Start->Run->"cmd"->OK should run the command prompt. Some people still call it a "DOS window".
steveth45

Member

Posts: 536
From: Eugene, OR, USA
Registered: 08-10-2005
If you're not comfortable using the command prompt, you can just make a batch file (a text file that ends with .bat, like play.bat) in the folder and put this line in it:
NinjaRobotAttack -nosnow
Then, all you have to do is double-click the batch file in explorer and it will run the game without the snow effect.

------------------
+---------+
|steveth45|
+---------+

buddboy

Member

Posts: 2220
From: New Albany, Indiana, U.S.
Registered: 10-08-2004
I KNOW WHAT THE HECK A STUPID COMMAND PROMPT IS... I was wondering if he had a prompt to go with it!

------------------
In the stock market, you must buy high and sell low...Wait! That's not right!
--------------
Yes, I can be intelligent at times!!

HanClinto

Administrator

Posts: 1828
From: Indiana
Registered: 10-11-2004
Whoa -- easy there. I'm just trying to answer the questions you asked. When someone says "run this from the prompt like this", it usually means the command prompt. I figured you didn't know that (since you asked), so I answered.

If you already know all this stuff, then please don't ask the questions, and I won't have to waste my time answering you.

Respectfully,
clint

[This message has been edited by HanClinto (edited March 29, 2006).]

Lava
Member

Posts: 1905
From:
Registered: 01-26-2005
I just played your game, steveth45, and it's really cool, did you do all of modelling? Because the gun is really good.

------------------

steveth45

Member

Posts: 536
From: Eugene, OR, USA
Registered: 08-10-2005
Thanks!
I modeled the ninja robots, the "level", and the ninja stars from scratch in Milkshape 3D. The sweet gun was a free model on some modeling tutorial page. I did all the lame animation myself. The sound effects were all free ones I found on the internet, though I did tweak around a bit with them. I am not much of an artist, it took me a ridiculously long time to do the ninja robot model. That's part of the reason they are animated so poorly, because I just didn't have the time or energy to do better. Just as guitarists will always need drummers and bass players, so game programmers will always need artists and modelers. There is a readme.txt file in the game files that explains which assets I personally created, so I'm not taking credit for anyone else's work.

Also, thanks for everyone trying the game out and helping me work out the bugs. I'll post the source tonight.

------------------
+---------+
|steveth45|
+---------+

steveth45

Member

Posts: 536
From: Eugene, OR, USA
Registered: 08-10-2005
Oh yeah,
For you linux people (CPUFreak), I tried installing a different distro than I usually use and it was a mess, so I'm switching back to the one I started on: Mandrake (Mandriva now). It may not be everyone's favorite distro, but at least I know how to develop on it. I'll try to get the linux version of NinjaRobotAttack running ASAP.

God Bless

------------------
+---------+
|steveth45|
+---------+

HanClinto

Administrator

Posts: 1828
From: Indiana
Registered: 10-11-2004
Hey, Steveth!

Yay, it worked! Great job figuring out the access violation -- good job!

I tested it without sound, so I don't know how it does with sound.

Very nice! It was pretty slow, so I tried it with the -nosnow option, but it still chugged some. I'm not sure if it had anything to do with the number of bots on screen -- it seemed to be more general than that. I would guess it was around 10-15 FPS.

Athlon 1800+
512 RAM
Windows XP (freshly reinstalled a couple of weeks ago, so not bogged down by spyware -- yet)
GeForce 2 MMX (which may be my problem, as it's a card that's a good 4 or 5 years old).

This is a pretty good card though, and can run intensive games like Jedi Knight: Outcast and Serious Sam pretty handily -- I'm not sure why it would chug so hard with this game.

Optimization aside, it looks really good! I'm impressed you were able to write this in so few lines of code -- I'm really looking forward to your presentation on this at the CGDC. Great work!

I was able to get up to wave 5 or so before I got bored and decided to write this post.

In Christ,
clint

buddboy

Member

Posts: 2220
From: New Albany, Indiana, U.S.
Registered: 10-08-2004
lol i'm really sorry HanClinto... i was just really frustrated and stressed at the moment... and when that happened, it just all went out at the first thing i saw that might come close to something that could make me upset... lol.. sorry!

------------------
In the stock market, you must buy high and sell low...Wait! That's not right!
--------------
Yes, I can be intelligent at times!!

buddboy

Member

Posts: 2220
From: New Albany, Indiana, U.S.
Registered: 10-08-2004
the nosnow makes it a lot faster for me...

------------------
In the stock market, you must buy high and sell low...Wait! That's not right!
--------------
Yes, I can be intelligent at times!!

steveth45

Member

Posts: 536
From: Eugene, OR, USA
Registered: 08-10-2005
Hey Clinto,
Thanks for the feedback. I'm sorry the game is slow for you, but it is a six year old video card. I think you can get a GeForce 5200 (1000X faster) for about $30 on Ebay. Plus, you can sell yours for about $15. You can become part of what I call The Great Chain of Technology . At each step, there is a higher transistor count and cooler effects like stencil shadows and high dynamic range lighting. Men everywhere are sending each other bubble-wrapped packages with electronic components and exchanging invisible money through PayPal. It is quite a sight to behold. I used to be deeply involved in the Great Chain, but I grew weary. Now I just shuffle around thrift shops looking for used laser printers and such.

------------------
+---------+
|steveth45|
+---------+

steveth45

Member

Posts: 536
From: Eugene, OR, USA
Registered: 08-10-2005
The source code is now available for download on my webpage. If you are interested in C++, 3D game programming, using the Irrlicht engine, or using the Audiere sound library, please check it out. You may need to look at irrlicht.sourceforge.net to see how to set up your particular IDE for compiling demos for Irrlicht.

Enjoy!

------------------
+---------+
|steveth45|
+---------+

buddboy

Member

Posts: 2220
From: New Albany, Indiana, U.S.
Registered: 10-08-2004
yay!! source!!!!!!!!!!!!!!!!!!!!!!!!!!!!... lol... i liked the joke...

------------------
In the stock market, you must buy high and sell low...Wait! That's not right!
--------------
Yes, I can be intelligent at times!!