PDA

View Full Version : How would I go about making a RTS game?




polar-blair
Sep 20, 2008, 09:59 AM
Hi

I dont know if anyone has heard of the game Castle crashers for the Xbox 360. Well anyway I love it! So I though it might be fun to try and make a simple RTS game. I have use of photoshop, illustrator and flash. Will those programs do for the graphics. I want the game to visually look like castle crashers, very simple and cartoony.

I havnt done any programing so I was hoping that there was a program that was more interface ran rather than solid coding.

Has anyone managed to make a RTS game? How difficult is it? is it worth doing?



Eric5h5
Sep 20, 2008, 03:58 PM
I havnt done any programing

Start learning. ;) It's not really possible to make anything worthwhile without programming. You can manage to find engines that work graphically that promise to make things "easy", but they always seem to have various limitations that prevent you from really doing what you want. Start out by learning ActionScript with Flash...just do a lot of simple things at first; don't think about trying to do a RTS right off the bat. There are a lot of resources and tutorials out there. When you start to feel like you have a handle on it (expect this to take months at least; starting from scratch isn't trivial), move up to Unity (http://unity3d.com), which is a kick-ass environment for making any kind of game you can think of, in any style that you want. It would be fairly simple to transfer knowledge of ActionScript to Javascript in Unity, which is only superficially like "web" Javascript.

--Eric

skinnybeans
Sep 20, 2008, 05:23 PM
Take a look at Torque Game Builder. http://www.garagegames.com/products/torque/tgb/

It has a really nice graphical editor for laying things out and a scripting language for doing 90% of what you will ever really need to. And if you really really want to go the whole hog you can get a full license and edit the engine code directly in C++. They have also released ports for consoles as well so if you ever do come up with an awesome game getting out on 360 is always a possibility :)

There is a free 30 day demo available. I've tried it out and was pretty impressed with it, never really did all that much with it though (programming all day at work, sorta sick of it by the time i get home...)

tominated
Sep 21, 2008, 03:23 AM
the guy behind castle crashes (i think) is the guy behind alien hominid and he's called synj (or sinj) on teh intarwebs. He started out as a flash dev making alien hominid in flash, which is almost exactly the same as the console port. It is possible, but it could take a loooooong time

HiRez
Sep 21, 2008, 02:42 PM
Take a look at Torque Game Builder. http://www.garagegames.com/products/torque/tgb/

It has a really nice graphical editor for laying things out and a scripting language for doing 90% of what you will ever really need to. And if you really really want to go the whole hog you can get a full license and edit the engine code directly in C++. They have also released ports for consoles as well so if you ever do come up with an awesome game getting out on 360 is always a possibility :))
Actually, there is also an RTS Starter Kit (http://www.garagegames.com/products/54/) available for Torque ($50). Might be a good way to get something started and get inspired before you dive into "real" programming, although this should get you thinking about game design, which is just as important. It's not free but considering how much work it would take you to make something even remotely like that from scratch it's probably well worth it.

NaughtyOttsel
Sep 21, 2008, 02:50 PM
the guy behind castle crashes (i think) is the guy behind alien hominid and he's called synj (or sinj) on teh intarwebs. He started out as a flash dev making alien hominid in flash, which is almost exactly the same as the console port. It is possible, but it could take a loooooong time


The online version was programmed by Tom Fulp, who owns Newgrounds; while the 2D artwork was done by Dan Paladin (who also goes by the online alias "Synj").

Almost, Tom Fulp did the programming for Castle Crashers, whereas Dan did the graphics again.

Muncher
Sep 21, 2008, 05:50 PM
I recommend the programming language C, if you're willing to learn. Then, you can learn either Allegro or SDL, both are quite easy.

ChrisA
Sep 21, 2008, 08:02 PM
I havnt done any programing so I was hoping that there was a program that was more interface ran rather than solid coding.

Has anyone managed to make a RTS game? How difficult is it? is it worth doing?

You are going to have to learn a lot. Not just some rather advanced software engineering but math too, and basic physics. Typically these games are not the work of one person, The level of effort for a very simple game like you describe is about a man-year (about 2,000) hours but that assumes you have the require experience and education.

What some people do is write a "theme" or "level" for an existing game. There are a number of games that allow you to do this. This would have you a few years on the xperience and education side.

mobilehaathi
Sep 21, 2008, 10:05 PM
You are going to have to learn a lot. Not just some rather advanced software engineering but math too, and basic physics. Typically these games are not the work of one person, The level of effort for a very simple game like you describe is about a man-year (about 2,000) hours but that assumes you have the require experience and education.


Yep. Math, basic physics, algorithms, basic AI, a good command of C/C++, and good command of some graphics APIs...

Oh and time. Lots of time.

Eric5h5
Sep 22, 2008, 05:08 AM
Yep. Math, basic physics, algorithms, basic AI, a good command of C/C++, and good command of some graphics APIs...

Oh and time. Lots of time.

There's really no point doing everything from scratch like that...too much reinventing the wheel. Use Unity like I mentioned above and you save a huge amount of time and it's a lot more fun as well. You still need to know how to program though, but you're saved from the tedium of C/C++.

--Eric

mobilehaathi
Sep 22, 2008, 06:45 AM
There's really no point doing everything from scratch like that...too much reinventing the wheel. Use Unity like I mentioned above and you save a huge amount of time and it's a lot more fun as well. You still need to know how to program though, but you're saved from the tedium of C/C++.

--Eric

I guess it depends upon to what extent you want have control over your creation. Although that Unity does look reasonably well done. :)

Eric5h5
Sep 22, 2008, 04:50 PM
I guess it depends upon to what extent you want have control over your creation. Although that Unity does look reasonably well done. :)

These days it's all about middleware...things have gotten too complex for it to be feasible for most people to write their own engines. 99% of anything you can imagine can be done with Unity, and for that last 1%, there is a source code license available, although I gather it's not cheap.

--Eric

Muncher
Sep 22, 2008, 07:33 PM
These days it's all about middleware...things have gotten too complex for it to be feasible for most people to write their own engines. 99% of anything you can imagine can be done with Unity, and for that last 1%, there is a source code license available, although I gather it's not cheap.

--Eric

True dat, at least on desktop computers. Technology has become so complicated, and users so demanding (which is the real killer), that it takes real dedication to write everything from scratch. On the App Store, with the NDA still in effect, and people still not sure what's "allowed" or "possible," writing it all is a requirement. But Obj-C makes it a bit easier, or so I've heard.

Want to see real coding genius? Check out this website (http://pouet.net/prodlist.php?order=views), or this one (http://www0.us.ioccc.org/main.html).

polar-blair
Sep 23, 2008, 01:53 AM
Thanks for all the reply's

After a little looking on the web I soon realised that making a game is quite complicated, so I decided to go with the flash route and use action script, As I already have flash and have used it to make some animations but never got as far as using action script.

I found a few tutorials with all the different game elements I wanted. But the problem I am having is to bring them all together.

I started of with a single picture of my character, and got him to move left and right, then brought in acceleration and friction, so he slides around a little.

The I used another tutorial to animate the character so when he moves left and right he looks like he is walking and when he stops he stays still.

Then I found a tutorial on how to make your character jump which usually goes a messed up. Gravity works, but I cant seem to get the blocks to act as ground, he just falls through them.

So At the moment I want to create a game like this.
http://www.gotoandplay.it/_articles/2003/12/scrolling_upd.php

But I when I try and download the tutorial I get a page of gibberish.


The code I have got so far is this

onClipEvent (load) {
power = 0.3;
yspeed = 0;
xspeed = 0;
friction = 0.95;
gravity = 0.1
}

onClipEvent (enterFrame) {
if (Key.isDown(Key.LEFT)) {
xspeed -= power;
}
if (Key.isDown(Key.RIGHT)) {
xspeed += power;
}
xspeed *= friction;
yspeed += gravity;
_y += yspeed;
_x += xspeed;
}


Can any one help me, I need a way to tell the character to stop falling when he hits the ground. A Jump command. And a way to make the screen scroll from side to side as he walks.

I found this code which does the side scrolling part but I cant figure out where in the code it appears
onClipEvent (load) {
speed = 0;
maxmove = 15;
}
onClipEvent (enterFrame) {
if (_root.dead) {
this.gotoAndStop("dead");
} else {
speed *= .85;
if (speed>0) {
dir = "right";
} else if (speed<0) {
dir = "left";
}
if (dir == "right"){
this._x += speed;
_root._x -= speed;
}
if (dir == "left") {
this._x += speed;
_root._x -= speed;
}
if (Key.isDown(Key.LEFT)) {
if (speed>-maxmove) {
speed--;
}
this.gotoAndStop("run");
this._xscale = -100;
} else if (Key.isDown(Key.RIGHT)) {
if (speed<maxmove) {
speed++;
}
this._xscale = 100;
this.gotoAndStop("run");
}
if (speed<1 && speed>-1 && !attacking) {
speed = 0;
this.gotoAndStop("idle");
}
}
}

I dont expect anyone to rewrite my code for me. but any help or guidance or direction to a tutorial that works would be great.

I think once I get my character working, and the scrolling part of the level working I should be able to achieve what I am aiming for.

Eric5h5
Sep 23, 2008, 02:36 AM
On the App Store, with the NDA still in effect, and people still not sure what's "allowed" or "possible," writing it all is a requirement. But Obj-C makes it a bit easier, or so I've heard.

Nope, you can do that with Unity too. :) Or will be able to, as of Oct. 22.

--Eric

Muncher
Sep 23, 2008, 06:26 PM
Nope, you can do that with Unity too. :) Or will be able to, as of Oct. 22.

--Eric

Cool. Expensive, though.

Eric5h5
Sep 23, 2008, 10:07 PM
It's actually very inexpensive compared to a lot of other engines, especially considering its capabilities.

--Eric

Muncher
Sep 23, 2008, 11:18 PM
It's actually very inexpensive compared to a lot of other engines, especially considering its capabilities.

--Eric

Inexpensive, 'cept when compared to those free ones. :p

I've never used Unity, so I can't say if it's worth the money or not. I can say that if you don't like a free engine, it's not like you're down any money.

Eric5h5
Sep 24, 2008, 12:30 AM
The essential lack of any professional games made with free game engines pretty much tells you right there all you need to know about those. ;) I'm talking about professional-grade engines where you can expect to see prices like $5K and up.

I've never used Unity, so I can't say if it's worth the money or not.

Every cent, and then some. It has a free trial though (with no limitations of any sort aside from lasting 30 days, though you can extend that too), so you don't have to take my word for it.

--Eric

polar-blair
Sep 24, 2008, 12:37 PM
Well I've had a little look at unity and I think its far to advanced for me, Im going to stick with flash for now. I only wanted to make a 2D game :)

its proving a little bit tricky, I am almost there, the only things im struggling with is triggering the animations (Movie Clips) when I get him to walk, And I cant get the character to recognize the platform so he doesn't just fall through everything.

Has anyone found a good example code I can use as a base and then customize, because creating one from scratch is proving difficult.

koenahn
Feb 26, 2010, 01:29 PM
Hi Polar blair!
I srarted working on the same kind of project, and have also been struggling with making the character jump properly.
the hard thing is indeed that you need an up-to-date boolean that is true when your player is touching the ground and is false when it's not.
this is the code that i've made for it, and it WORKS.



var velocity:Number = 20;
setInterval(walk(), 25);
setInterval( groundCheck(doll_mc), 25);
setInterval(informAboutGC(), 25);

var nrOfGrounds:Number = 2; //Keep this up to date!

function groundCheck(obj:MovieClip):Boolean{ //returns boolean //groundCheck(<objectName>);
for (var i:Number = 1; i <= nrOfGrounds; i++) {
if (obj.hitTest(_root["ground" + i + "_mc"])){
return true;
}
}
}

function informAboutGC():Void{
output_txt.text = "groundCheck(doll_mc) = " + groundCheck(doll_mc);}


function walk():Void{
if(Key.isDown(Key.RIGHT)){
doll_mc._x += velocity;

}if(Key.isDown(Key.LEFT)){
doll_mc._x -= velocity;

}if(Key.isDown(Key.UP)){
doll_mc._y -= velocity;

}if(Key.isDown(Key.DOWN)){
doll_mc._y += velocity;

}
}

on stage, i have:
the "character" (it still looks like a red cube), doll_mc
a textfield, output_txt
two instaces of "ground", one named "ground1_mc" and one called "ground2_mc".

cheers!


EDIT:
i just noticed that we might actualyl be using different actioncripts, in that case we won't be able to help eachother very much, except for the "idea" thing...
I use 2.0