Blender Can Do RTS

Hello everyone,

I’m always messing around with Blender. And now I gave RTS a try. I noticed that it isn’t really hard to make it in Blender and you won’t have to worry about performance either!

Videos:
First Tests
Making the Barracks (model) and placing buildings (basic system)

Image:
http://www.anicator.com/sg/army/Blender_RTS_00.jpg

Enjoy,

- AniCator

The world can be such a mess.
http://www.anicator.com/sg/army/Blender_RTS_01.jpg

It’s way too high-poly!

Yeah. But since it doesn’t cost that much performance I was thinking to leave it like that for a while until the official releases of the Apricot builds are published.
This isn’t Apricot Blender. It’s 2.46, the original one.
Awesome performance! And my second reply in this thread is just a performance test. I don’t think you’ll be placing that much Barracks during your game. It won’t be possible either because you won’t be able to overlap the buildings like I did in the image.

Thanks for your reply, comments and suggestions are appreciated.

- AniCator

But it says on 7 FPS…how is that “awesome”?

I believe that the greater concern in blender is going to be the AI and the pathing because the slightest bit of screwy AI or pathing can totally alienate a player from an RTS game even if the game is a multiplayer experience - there are still idle targeting priorities, pathing as I mentioned, and other things.
I’m not familiar with blender’s performance when it comes to logic to say for sure - although I hear that Crystal Space might be pretty good for that. Not that I’m saying blender wouldn’t be I just haven’t tested it.

http://code.google.com/soc/2008/crystal/appinfo.html?csaid=A7B881CB4598C9A2

Like I told you. Have you checked the amount of Barracks that are placed in that scene?
I don’t think you got my point.
One of the red squares indicate which one is a single bunker. All the other bunkers are just placed there. If I would have to tell you how many I placed there I would say about 250 bunkers. Do you expect 250 buildings to be displayed on your screen in an RTS game?

I’ll reply to the other replies as soon as I’ve hosted a new video in which I make it possible to use the mouse to move the red polygon.

- AniCator

PS: .blend will be included. Script was made manually using the template in the API documentation.

Blender Can Do RTS Mouse Ground Cursor

It was on my list of ideas and I knew this one was going to take me some time.
Coding this script in Python took me some time since it was a Trial & Error process.

Mistakes I made:

  • Save the .blend but not the .py file.
  • Check for information about Rasterizer in the wrong API documentation.
  • Python dLoc typo which was ‘DLoc’ instead of ‘dLoc’.
  • Behind-the-scenes: Forgot to compress the .wav files to 128kb/s mp3s.Don’t worry. I faced them and fixed them.

You can now use the mouse to move around the ‘object-placer’ and the camera will follow the object too. I am not sure if the camera needs a script instead of the use of SlowParent. We’ll see. If it starts to squash&stretch the viewport then I’ll use the same script I used for the camera in Ancient Legend to fix the SlowParent issue.

I said I would upload the .blend too. So here it is.
The ‘object-placer’ doesn’t place the object any more. I’m going to re-do that.

Download: p1_test_public_packed.blend

Timelapse Video: http://www.anicator.com/2008/07/06/blender-can-do-rts-3/

Yes. It is an issue. But I also think there are a lot of lazy Blender users that want to make games with the game engine but do not want to write Python scripts. I’ve seen AI project doing very well. I hope I’ll be good at it too.

AI Path-finding in Blender is probably connected to large Python scripts that use a lot of Ray, Collision and Material detection sensors.

- AniCator

So… you made 250 barracks on top of each other :eek:

I take it you’re testing for a game like Lordof the Rings, Battle for Middle Earth or Command & Conquer?

Just saw your videos, it looks very nice. COngratulations! Are you planning on taking this any further? Maybe trying a simple RTS game?

I’m not sure. We’ll see.
I said it was part of the ShortGame project so it’ll probably become a simple RTS game.

- AniCator

PS: It could be more than 250. Anyone volunteering to count?

EDIT: I placed them in-game, it made it a lot easier.
EDIT2: Messing around.
http://www.anicator.com/sg/army/Blender_RTS_02.jpg
EDIT3: I encountered an interesting bug making the terrain’s texture project onto the other models when viewing them from a certain view (when the models are placed behind hills while you can still view like the flag of the HQ).
http://www.anicator.com/sg/army/Blender_RTS_03.jpg

Another stress test with information about the amount of buildings (you can trust this property, I triple checked it)
http://www.anicator.com/sg/army/Blender_RTS_04.jpg

Hey Plant! Any further questions? :stuck_out_tongue:

- AniCator

cool tests!- I imagine you will be testing some moving objects and object spawning soon?- nice cursor-D

Darn it.
I wonder what causes this to happen. Pay attention to the textures of the terrain.
http://www.anicator.com/sg/army/Blender_RTS_05.jpg

- AniCator

OMG !!! this is AWESOME!!!..

i always wanna do RTS game like CNC series and StarCraft Series… or like WIC… >_<

damn AniCator
ur AWESOME!!!

Anything is possible if you’re good at programming, have decent art skills, and if you can balance them well.

Lets see how all this runs after implementing AI, logic, and animation…

I don’t think you’ll be getting that “awesome” 7 FPS high performance you’re getting now.

It would be interesting to see how you use the knowledge that you gain in these tests for your “Ancient Legend” project.

Why would a player place 1992 buildings while five are enough?
And if you’re going to tell me about the amount of units the player will use:
Why would a player use more than 500 units? Why would they even get close to 500 (OK, if I screw up with while I code the AI’s production system then you’ll need to get close to 500 to beat those 3947293846237486 units of the enemy?

Speaking of “Ancient Legend”. Let’s just keep it quoted for a while and see if it’s worth the pain.
AI programming shouldn’t be hard. Unless you hate taking time for stuff. It would take more time to code then to think in my opinion.
When I’m programming it’s my logic brain that’s speaking.
Like:

If something_sucks==1:
      getRidOfit(exclamationMark);
      restorePerceptionOfDepth(orFixYourBrain);
 ElIf something_sucks==0 || something_doesnt_suck==1
      setSucces(True);
      print "Lucky asshole! Wait. I thought I disabled the console! HOW DID YOU GET IN
      HERE!"
      createWindowThingy("Text telling you, you succeeded!")

- AniCator

I didnt realize there was 1,992 buildings in the scene, that’s insane! Did you do your test with or without display lists enabled?

What’s the polycount of the whole scene?

I’m watching this…

What I think people are trying to say is that while Blender can, at the moment, handle thousands of polygons, RTS games are all about the AI. With these barracks that you placed in the scene, did they each have a three hundred line script, a health system, an animation system and a series of changing variables running continuously?

If not, that is what people are talking about. Polygon count, Object count, texture count mean nothing if you don’t factor in the giant CPU using factors.

EDIT:
I also forgot to mention that python (I assume you’ll be using it just for the ease) is magnitudes slower than C++ and many other languages just because it is compiled and run, compiled and run for every time through of the code.

Try having two hundred scripts running at once - even simple ones.

EDIT 2:
Yeah… Blender seems to pause while one script is not done

a = 1
while a &lt; 100000:
	a += 1
	print a

The scene cannot continue while one script is still running. In other words, it needs to run through each instance of the script before it goes to the next frame.