123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|590|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> Handheld Coding -> Porting C&C : Is it possible, is it cheap, and is it legal

Fri, 10 Aug 2007, 06:13
Blitz3Dman
I would like to try and make it so I can play C&C95 and/or Red Alert(1) on my DS. I figure If I can get a cartrige and writing utilities, I can find out how to modify the code to work on DS. Is this possible? Is it cheap? I don't have much money I'd be willing to spend on it. And is it legal if I keep the game to myself, and make only one cartridge? In case it makes any difference, C&C95 came out in 1995 and Red Alert in 1996.

-=-=-
There are 10 kinds of people in this world -

( Insert 16 remarks about to what extent people know hex here )
Fri, 10 Aug 2007, 06:32
JL235
If you had the source code (which you can't get) It'd be a case of porting it over. I'd imagine it could be straight forward but very time consuming. Otherwise it's a case of emulating Windows 95 (to a degree) on the DS.

Plausible: maybe. Easy: no. Illegal: probably not (if you were emulating).
Fri, 10 Aug 2007, 09:08
Jayenkai
A better option, to a certain degree, would be to start from scratch and write your own.
It might seem harder to do, but you'd be aiming at a specific hardware type, so you can cut all kinds of corners!
That is to say.. When making a Windows game you might need to consider different hardware, different resolutions, and other things.
On the DS, you don't.. If it runs on yours, it'll run on everyones (assuming it runs at all, depending on the card!!)

Graphic issues would be the hardest. Perhaps try to find someone willing to create a load of C&C esque graphics for you.

-=-=-
''Load, Next List!''
Fri, 10 Aug 2007, 14:20
spinal
I'm sure I seen some canon fodder gfx on the net somewhere, they'd probably be a good start.

-=-=-
Check out my excellent homepage!
Sat, 11 Aug 2007, 15:42
Blitz3Dman
I've wanted to code an RTS for a while, but I don't know how I'd get the map scrolling down. Help?

-=-=-
There are 10 kinds of people in this world -

( Insert 16 remarks about to what extent people know hex here )
Sat, 11 Aug 2007, 17:10
JL235
When drawing add on an offset to the entities x/y co-ordinates. So they are drawn at x+offsetX/y+offsetY. When the mouse touches the side of the screen, you increase or decrease the appropriate offset, with an appropriate maximum and minimum value to stop it from scrolling infinitely.
Sat, 11 Aug 2007, 18:32
Blitz3Dman
but the problem arises of keeping fps high by not drawing off screen objects, but still updating them.

If anybody has an example of a basic blitz RTS engine, that would be very nice.

-=-=-
There are 10 kinds of people in this world -

( Insert 16 remarks about to what extent people know hex here )
Sat, 11 Aug 2007, 18:42
Scherererer
well then you'd just do a simple check to see if the tile would land within the screen coordinates or if it goes outside them as to whether or not to draw it

-=-=-
YouTube Twitter
Computer Science Series: Logic (pt1) (part 2) (part 3) 2's Complement Mathematics: Basic Differential Calculus
Sun, 12 Aug 2007, 03:03
Jayenkai
if x+TileWidth+offsetX>0 and x+offsetX<ScrW and y+TileHeight+offsetY>0 and y+offsetY<ScrH
Draw me
endif

And, make sure that TileHeight is the specific tile's height, not the standard tile. That way, you can create a few larger tiles for buildings and things, and they won't suddenly start popping into view when 1/2 their tile is visible!

-=-=-
''Load, Next List!''
Sun, 12 Aug 2007, 04:20
JL235
You don't need to check. Blitz won't draw things off screen. If you try the draw function it will return super fast. I presume DirectDraw does it's own check deep down to ensure you aren't blitting an image into some random memory outside the buffer.
Sun, 12 Aug 2007, 04:30
Jayenkai
But... He's doing it in C for the DS.. (Or at least, that was the initial plan, anyway!)

-=-=-
''Load, Next List!''
Sun, 12 Aug 2007, 05:50
JL235
I'd still expect the DS would do something similar. Maybe you should make two simple programs, both that time how long it takes to draw an image 1,000 times. First program will draw the image on-screen, the other off-screen.

Only then will you truly know.
Sun, 12 Aug 2007, 05:51
Jayenkai
The DS screen does a wraparound thing. If you beyond the size of the tilesheet, it pops back onto the other side of the screen!

-=-=-
''Load, Next List!''
Sun, 12 Aug 2007, 05:56
JL235
So how would you draw something onto the edge of the screen? Like a tank that was half on screen?
Sun, 12 Aug 2007, 06:22
Jayenkai
If you're using sprites, there's (I think) a 512x512 wraparound.. For tilemaps it depends on the size you set, from 256x256 up to 512x512.

-=-=-
''Load, Next List!''
Sun, 12 Aug 2007, 07:06
Blitz3Dman
Meh, I suppose this means no C&C on my DS without spending a bunch of money and having to try and get it to work.

Well, thanks anyway.

I still would need a basic rts example if I was to code one. The only thing I know how I'd do is make the units and make them player controlled; that's about it. Except now I think I know how I'd to the screen scrolling.

I definately am not ready for a C++ rts. I know cout cin and I have to look back in my book for ifs fors and whiles. I'm not even toally used to the maths.

-=-=-
There are 10 kinds of people in this world -

( Insert 16 remarks about to what extent people know hex here )
Sun, 12 Aug 2007, 07:54
JL235
There are several open source RTS games out there for you to look at. I also wouldn't recommend a C++ RTS. Instead I'd suggest a C# or Java RTS because they are easier safer languages and because of their libraries. It'd also be easier to port to C++ later (although I wouldn't see much point in that).
Sun, 12 Aug 2007, 09:37
Blitz3Dman
If I'm going to code an rts it's going to be blitz... It's the only language I know well enough to do something like that.

-=-=-
There are 10 kinds of people in this world -

( Insert 16 remarks about to what extent people know hex here )
Sun, 12 Aug 2007, 09:57
ingenium1
Diablos is right. I am using C# and I must say it is really easy.

-=-=-
Roger Federer is go(o)d.
But he is not alone.

Just relax... sometimes there's no need to argue.
Tue, 14 Aug 2007, 04:10
abc
This tell something about him.
On the 11th he asked for a tutorial to learn C#, on the 12th:
"Diablos is right. I am using C# and I must say it is really easy."

Isn't he a lamer?

Tue, 14 Aug 2007, 07:34
JL235
abc, don't take this off topic.

One big problem with making an RTS in Blitz is how to make all the unique units. With an object-oriented language it'd be straight forward to make an inheritance hierarchy to help model all the different kinds.

For example you could have a Unit class at the top which simply has a position, health and an image. Nothing more.

That could be extended by GroundUnit and AirUnit classes, for modelling units that are in the air and on the ground.

GroundUnit could then be extended by Tank and Infantry classes, again for modelling differences between them. For example Tank objects can run over Infantry objects, and Infantry objects can be positioned into a formation.

Infantry could then be extended by Medic, Soldier and Grenadier classes. For modelling those individual units.
Tue, 14 Aug 2007, 14:34
Phoenix
Well there's nothing saying that's the way it has to be done; Warcraft III doesn't do it that way and it works just fine. An RTS in Blitz is very possible, but there may be problems other than the one you brought up.
Tue, 14 Aug 2007, 14:50
ingenium1
Soemone made once a good RTS in Blitz... something with robots... *ingenium searches the link*
He was a CW and BB member... i cant remember his name :\

I found it!!!!
here it is:
hnphan.com/program_code.html
TigerZ got a job at Ea games... he is a god.
The game is called "surviving". It's not really an rts, but it is similar to.

-=-=-
Roger Federer is go(o)d.
But he is not alone.

Just relax... sometimes there's no need to argue.
Tue, 14 Aug 2007, 15:13
Scherererer
One big problem with making an RTS in Blitz is how to make all the unique units. With an object-oriented language it'd be straight forward to make an inheritance hierarchy to help model all the different kinds.

For example you could have a Unit class at the top which simply has a position, health and an image. Nothing more.

That could be extended by GroundUnit and AirUnit classes, for modelling units that are in the air and on the ground.

GroundUnit could then be extended by Tank and Infantry classes, again for modelling differences between them. For example Tank objects can run over Infantry objects, and Infantry objects can be positioned into a formation.

Infantry could then be extended by Medic, Soldier and Grenadier classes. For modelling those individual units.


Only problem with that though is that it doesn't allow for good extensibility, because you couldn't just script in a new unit, you'd have to create a new class.

-=-=-
YouTube Twitter
Computer Science Series: Logic (pt1) (part 2) (part 3) 2's Complement Mathematics: Basic Differential Calculus
Thu, 16 Aug 2007, 08:01
Blitz3Dman
thanks ingenium, but I was more looking for a 2d one.

-=-=-
There are 10 kinds of people in this world -

( Insert 16 remarks about to what extent people know hex here )
Thu, 16 Aug 2007, 08:34
Teasy
If you leave out more in-depth things like pathfinding and AI, you can do it in a day!
Btw, the old Command & Conquer used a rather tricky tile system, but I've managed to create a tile ripper to once again admire those good'ol graphics I love so dearly