The Daily Click ::. Forums ::. Klik Coding Help ::. I need help with my new Real time strategy game
 

Post Reply  Post Oekaki 
 

Posted By Message

Fredrik Ortmon



Registered
  10/03/2006
Points
  219

Game of the Week Winner
7th April, 2008 at 08:14:39 -

Hello folks, Itīs me Fredrik who made the GOTW War of Antarctica and i have started on a new project.
Itīs still a RTS but in a fantasy world.

Well well, im having problems with the the detection of the units (For my units to auto-attack the enemy).
Im not going to use the same system as War of antarctica since it was quite buggy (And took lots of memory, there were big invisible objects that worked as detectors for all units)



Image

This is how far i can get. But it doesnt work if i have multiple enemies, they dont know which to choose and just ignore them..
Image


Any help would be appreciated

Image Edited by the Author.

 
yo

Neuro

Ludologist

Registered
  29/10/2006
Points
  437

Game of the Week WinnerVIP MemberI'm on a BoatPokemon Ball!
7th April, 2008 at 09:03:53 -

I'm not sure about this, but have you tried putting the 'pick one of []' condition at the top of the event?

Otherwise I have no idea. It might be easier with built-in detectors, though:
http://create-games.com/article.asp?id=1639

I've been using them a lot and they're a huge help for any kind of movement! Good luck with your new RTS, it's looking really neat!

 
n/a

Retainer



Registered
  02/06/2005
Points
  218
7th April, 2008 at 11:16:58 -

You need to find a way to select the enemy nearest to the friendly unit. This can be done to advanced direction object, dunno how though.
With your current engine, you only test the how far the last created unit is from the last created enemy.

I also think you need to give every friendly unit a ID and fastloop through them, testing them individually.

GLHF



 
Alien Invasion. Going forward!
http://www.create-games.com/project.asp?id=1092

Fredrik Ortmon



Registered
  10/03/2006
Points
  219

Game of the Week Winner
7th April, 2008 at 14:11:37 -

Thanks for all the quick answers !

Im going to try it right away !

 
yo

Fredrik Ortmon



Registered
  10/03/2006
Points
  219

Game of the Week Winner
7th April, 2008 at 14:13:39 -

THANKS Neuro and Retainer!!

It works perfectly !
I put "Pick one" at the beginning.
Love this forum now im going to spend the rest of the night with the game

 
yo

Neuro

Ludologist

Registered
  29/10/2006
Points
  437

Game of the Week WinnerVIP MemberI'm on a BoatPokemon Ball!
7th April, 2008 at 16:19:00 -

Excellent, no problem

Hope you get everything working smoothly, I'm craving RTS games at the moment!

 
n/a

Retainer



Registered
  02/06/2005
Points
  218
8th April, 2008 at 18:01:45 -

Yeah, I myself am developing a RTS in MMF2, love the idea of more people making RTS:es at the moment. Great to be able to bounce ideas
Although I will try to recreate cooperative A* movement like the one used in Ages Of Empires, its nice to see how efficiently a simpler method runs. please post if it is any more problem! After all, best way of learning is by teaching (Right next to google your ass off)

 
Alien Invasion. Going forward!
http://www.create-games.com/project.asp?id=1092

Fredrik Ortmon



Registered
  10/03/2006
Points
  219

Game of the Week Winner
24th April, 2008 at 08:51:03 -

Damn your game seems really cool,Retainer !
Looking forward to it !

I havent been able to work on my game since ive been working 12 hours passes since 10 days back but i gave the game a little time and i noticed a problem that i have encountered with all my games.

Image


The units stack on each other ( I use "soldier1" colides with " soldier1" - Bounce )
Is there any easy way to do this ?

 
yo

NeoMonkey

Finnish Army Fire Commander

Registered
  01/12/2006
Points
  243

VIP Member360 OwnerI am an April FoolPS3 Owner
24th April, 2008 at 13:21:43 -

Put command, like:

Distance between soldier 1 and soldier 1 < 30
-bounce

or something like that, Also you can make the soldiers to bounce much further away or making system so the selected group walks in formation (I think this is the best way).

 
I have proven new mathematic formula to be true...

2D > 3D

Image


Fredrik Ortmon



Registered
  10/03/2006
Points
  219

Game of the Week Winner
1st May, 2008 at 17:58:57 -

Thanks i will try that !
That thing with formation, is that hard ?

 
yo

NeoMonkey

Finnish Army Fire Commander

Registered
  01/12/2006
Points
  243

VIP Member360 OwnerI am an April FoolPS3 Owner
2nd May, 2008 at 02:39:07 -

I think one way of doing with and it would be simple...

Use active object and when selecting sertain amount of troops and then you just always put them on sertain position. And in collision they move out of the collision (also in attack) and after its over, then again back in formation when moved.

Image Edited by the Author.

 
I have proven new mathematic formula to be true...

2D > 3D

Image


Odeon Marik



Registered
  05/05/2008
Points
  5
5th May, 2008 at 04:37:31 -

Hello!
Well, overlapping enemys are well known to me.
Commands like
enemy1 collides with enemy1
->bounce
are looking crappy.

Also, you cant say
x-pos of enemy1 < x-pos of enemy1

This wont work, because you compare the x-position with the same object.

I solved it this way:
1. Via fastloop, every enemy needs a little detector that always follows it. The detector must have the same ID as its enemy.
2. now you can say (again by using a fastloop):
x-pos of enemy1 < x-pos of detector_of_an_enemy (only, if the detector has a different ID as the enemy, otherwise the enemy would push itself aound)
-> set x-pos of enemy -1

The effect ist, that if enemys come to close to each other, they are pushed away from each other very smoothly.

I made this for 4 directions, so for example if an enemy comes in the upper right quarter of another one, he will be pushed 1 pixel up and 1 pixel to the right.

Sorry for my english, i hope, this is understandable.

 
n/a
   

Post Reply



 



Advertisement

Worth A Click