Jump to content


Photo
- - - - -

Advanced RTS Example


  • Please log in to reply
140 replies to this topic

#1 Fede-lasse

Fede-lasse

    AI Programmer

  • GMC Member
  • 2009 posts
  • Version:Unknown

Posted 02 May 2008 - 11:34 AM

Replies to topics in this forum are held to a high standard. Reviews must have a critique or suggestion for use to be approved. Read the rules here.


Title: Advanced RTS Example

Description: This is a RTS (Real Time Strategy) example I once made for some kind of game I had in mind. At first, I found out my base engine for the game was coded inefficiently, so I re-coded most of it. After adding comments and description, this was what it turned out to be. Moreover, I added more stuff like pathfinding, enemies, basic sprites (by me), etc., to make it seem more like an example/tutorial. Since then, it has grown a lot.

  • Some of the Features:
  • Unit pathfinding
  • Completely smooth movement using GM's motion_add()
  • Automatic enemy attacking
  • Multi-select and single-select
  • Enemy chasing (right-click when the yellow circle appears)
  • Basic healthbars above the units (when selected, of course)
  • Enemies with basic AI
  • Basic sprites
  • Minimap
  • Smooth view scrolling
  • An "defend on discovery" feature
  • Group adding/removing
  • Multiple unit types
Type: .gmk source file
GM Version: 8.0 (Pro)
Link: Download link here (GM7 version can be found here as well).

- - - - - - - - - -

Please read: I rarely check my topic for replies, so please comment on the page that I link to in the download instead of replying to this topic.

I get an email when someone comments there, so expect a quick response!

Edited by Fede-lasse, 28 April 2011 - 07:13 AM.

  • 0

#2 tdmgames

tdmgames

    GMC Member

  • New Member
  • 1641 posts

Posted 09 May 2008 - 04:31 PM

I saw this while you were building it, seemed pretty good, downloaded now and seemed much better :P

I see you took my quotes =P
  • 0

#3 erty906

erty906

    GMC Member

  • GMC Member
  • 340 posts

Posted 10 May 2008 - 01:33 AM

Excellent work! It works like a charm! I mean, not like a Lucky Charms' charm, but a real one, you see.
  • 0

#4 benetonmovie

benetonmovie

    GMC Member

  • GMC Member
  • 1368 posts
  • Version:GM:Studio

Posted 10 May 2008 - 01:37 AM

Very good, it works PERFECTLY.
  • 0

#5 Fede-lasse

Fede-lasse

    AI Programmer

  • GMC Member
  • 2009 posts
  • Version:Unknown

Posted 11 May 2008 - 11:37 AM

Thanks for the comments :P

Also, I just added minimap support, view scrolling (By edmunn) and enemy attack snapping.
  • 0

#6 blaketheawesomedude

blaketheawesomedude

    GMC Member

  • New Member
  • 295 posts

Posted 12 May 2008 - 07:13 AM

perhaps a lite version for us peasents?
  • 0

#7 Fede-lasse

Fede-lasse

    AI Programmer

  • GMC Member
  • 2009 posts
  • Version:Unknown

Posted 12 May 2008 - 08:43 PM

Out of the question... It uses too many functions and such, for it to be able to work with Lite.
  • 0

#8 P-entertainment

P-entertainment

    GMC Member

  • GMC Member
  • 1429 posts

Posted 13 May 2008 - 05:05 PM

There still seems to be an error when there are no enemies left, as fast as I press right mouse button it gives me an error that the variable x is unknown.
  • 0

#9 blaketheawesomedude

blaketheawesomedude

    GMC Member

  • New Member
  • 295 posts

Posted 14 May 2008 - 02:09 AM

ah oh well then i still learned from the scripts
  • 0

#10 Fede-lasse

Fede-lasse

    AI Programmer

  • GMC Member
  • 2009 posts
  • Version:Unknown

Posted 14 May 2008 - 12:47 PM

@P-entertainment: Yes, I noticed that in the end. I forgot to upload that fixed version.

I'll upload it right away :)

Edited by Fede-lasse, 14 May 2008 - 06:47 PM.

  • 0

#11 Elum

Elum

    GMC Member

  • GMC Member
  • 89 posts

Posted 15 May 2008 - 09:44 AM

Wow, Very smooth! This game engine has a nice set of controls, the path finding is pretty good too.
All we need now is a gobstopper factory and we have ourselves a full RTS game! :)

The game at the moment makes me think that I could do with a set of those classic stance controls for those units, Aggressive, Passive, Neutral and maybe even way point mode, but that of course would depend on the style of game someone would make.

This is definetly the best RTS Example / Tut I have seen so far.
  • 0

#12 Blue_eyes_zombie_2

Blue_eyes_zombie_2

    GMC Member

  • New Member
  • 70 posts

Posted 16 May 2008 - 08:36 AM

A very well done, detailed, sophistimacated (joke intended) Real-Time Strategy example. Can't wait for things like different enemies, buildings and other systems.

8/10 (The lack of features was the shortcoming)
  • 0

#13 masterofhisowndomain

masterofhisowndomain

    The Designer

  • GMC Member
  • 3643 posts
  • Version:GM8.1

Posted 16 May 2008 - 06:06 PM

I don't think this qualifies as an 'Advanced RTS Example' since it only skims the features of the genre. I found the tutorial quite helpful however, but I certainly couldn't begin to build an RTS game purely using this.
  • 0

#14 Gamestar1

Gamestar1

    GMC Member

  • New Member
  • 347 posts

Posted 16 May 2008 - 07:49 PM

Very nice. But when you replace the guy with a different sprite (tank in my case) it gets kind of glitchy. When you click, it really only moves part of the distance.
  • 0

#15 Fede-lasse

Fede-lasse

    AI Programmer

  • GMC Member
  • 2009 posts
  • Version:Unknown

Posted 17 May 2008 - 09:21 AM

@masterofhisowndomain: Of course not.

This is not a base engine. It just shows you how to move the units around and such. Enemy AI and building structures are currently not available. Maybe they will become available, but I dunno. For now, you have to implement that yourself.

Also, I named it Advanced RTS Example, because I couldn't find any other RTS example that had full movement and selecting.

@Gamestar1: I implemented motion_add() and various physics on purpose. If it's too annoying, try replacing motion_add() in the mp_move() script with mp_potential_step(). Not sure it will work, so you might need to edit it a bit :P

Regarding the glitching, try using a mask, e.g. a round circle. There appears to be a problem when using move_bounce_solid() in the collision event of a block or unit in GM. I had to use a loop to fix it... Well, almost.

Edited by Fede-lasse, 17 May 2008 - 09:17 PM.

  • 0

#16 stitches

stitches

    GMC Member

  • New Member
  • 133 posts

Posted 09 June 2008 - 08:51 AM

howcome when u get the units to move a really close range, they wont move. is there some way to change it?
  • 0

#17 Foxx

Foxx

    GMC Member

  • New Member
  • 710 posts

Posted 10 June 2008 - 08:11 AM

what it needs now is a square in the minimap that shows what your looking at so then you can know where your looking plus it would be really easy to put in
  • 0

#18 Fede-lasse

Fede-lasse

    AI Programmer

  • GMC Member
  • 2009 posts
  • Version:Unknown

Posted 10 June 2008 - 12:44 PM

@stitches:
There's a loop in the object, obj_control, that does this. Remove it, and it should work. If you want me to do this, then PM me.

@Foxx:
I don't quite get what you mean.

Edited by Fede-lasse, 12 June 2008 - 10:51 AM.

  • 0

#19 Foxx

Foxx

    GMC Member

  • New Member
  • 710 posts

Posted 13 June 2008 - 01:10 AM

what i mean is in the minimap there should be like a square or something showing where abouts you are on the map as in what your looking at like in the age of empire seris they have a square in the minimap showing where you are in the world
  • 0

#20 stitches

stitches

    GMC Member

  • New Member
  • 133 posts

Posted 19 June 2008 - 12:53 PM

[quote name='Fede-lasse' date='Jun 10 2008, 10:47 PM' post='2728066']
@stitches:
There's a loop in the object, obj_control, that does this. Remove it, and it should work. If you want me to do this, then PM me.


is it the last loop in the step event of obj_control. cuz i deleted it and nothing happened?
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users