Jump to content


Photo

Awesome 2d Rts Engine (similar To Warcraft/strcft)


  • Please log in to reply
101 replies to this topic

#61 stumlehb

stumlehb

    GMC Member

  • GMC Member
  • 197 posts

Posted 03 July 2011 - 04:05 PM

You guys thought this would never come hey?? JUST! RELEASED! AN! UPDATE! i uploaded version 0013.0 of my engine, which include an updated fog of war engine and a queue for building units. More details and picture in the first post. ENJOY!
And don't forget to report bugs/ask me questions!



I'm still trying to figure out how to increase the spacing between units in the formations.

edit: nevermind, I just figured out that its done by changing the 20's in object.selector alarm 1

Edited by stumlehb, 03 July 2011 - 07:09 PM.

  • 0

#62 freko

freko

    The Professional

  • GMC Member
  • 504 posts
  • Version:GM8

Posted 25 July 2011 - 08:50 AM

rude guss is a wonderful engine. Thanks for making itPosted Image.

btw, can you do units garrisoning in buildings?
  • 0

#63 Masterjohn74

Masterjohn74

    GMC Member

  • New Member
  • 358 posts

Posted 27 August 2011 - 05:03 PM

Hey i have a question when making gathering. How do you make the gathering animation length longer. What i mean is it seems that my animation dosent seem to finish and stops in the middle somewhere. i dont know what to change to make the animation go all the way through.
  • 0

#64 Masterjohn74

Masterjohn74

    GMC Member

  • New Member
  • 358 posts

Posted 04 October 2011 - 09:56 PM

Is it possible to make the standing animation to animate? for example if i want the person to blink or something else.
  • 0

#65 rude guss

rude guss

    GMC Member

  • GMC Member
  • 235 posts

Posted 23 January 2012 - 06:20 AM

New update: added magic casting system. How-to guide coming soon.

These is more information in the original post, as well as the download and a new picture.

Have fun.

Edited by rude guss, 23 January 2012 - 06:21 AM.

  • 0

#66 Masterjohn74

Masterjohn74

    GMC Member

  • New Member
  • 358 posts

Posted 25 January 2012 - 12:15 AM

Thanks for all of this!
  • 0

#67 rude guss

rude guss

    GMC Member

  • GMC Member
  • 235 posts

Posted 25 January 2012 - 01:42 AM

Hey i have a question when making gathering. How do you make the gathering animation length longer. What i mean is it seems that my animation dosent seem to finish and stops in the middle somewhere. i dont know what to change to make the animation go all the way through.


Sorry for the late reply, if you already haven't fixed this problem. The fix to this was realised by someone else, not me. The problem is that the length of the animation is linked to the 'sprite' that you chose for the unit in the 'object properties' window. This sprite doesn't affect any of the units animation, so what i did, was just pick a standing animation and made it have something like 60 frames of the unit just standing still. Let me know if you have already fixed this, or if it doesn't work.
  • 0

#68 KingBender

KingBender

    GMC Member

  • GMC Member
  • 145 posts
  • Version:Unknown

Posted 25 January 2012 - 07:24 PM

Always wanted to make an RTS but my coding is horrid :blush:

I'll check this out, thanks for making it :)
  • 0

#69 rude guss

rude guss

    GMC Member

  • GMC Member
  • 235 posts

Posted 28 January 2012 - 07:42 AM

BIIIIIIG Update! Includes: hotkey system, stunning, silencing and more! check out the first post for more info. Added plenty of new pictures showcasing the new features. How-To Guide will also be updated soon as well.
  • 0

#70 stumlehb

stumlehb

    GMC Member

  • GMC Member
  • 197 posts

Posted 30 January 2012 - 08:38 PM

BIIIIIIG Update! Includes: hotkey system, stunning, silencing and more! check out the first post for more info. Added plenty of new pictures showcasing the new features. How-To Guide will also be updated soon as well.


It is looking good.
I've noticed a minor bug. The unit will not display while the direction is 0.
So in the draw event of obj_unit_template, this:
if (direction > 332 && direction < 360) or (direction > 0 && direction < 22) {draw_sprite(state_anim[state,2],-1,x,y);}
should be changed to this:
if (direction > 332 && direction < 360) or (direction >= 0 && direction < 22) {draw_sprite(state_anim[state,2],-1,x,y);}


Also, got this error when casting chain lightning, but couldn't reproduce it when trying again:
ERROR in
action number 1
of Step Event
for object obj_unit_template:

Error in code at line 524:
switch (cast_type)
^
at position 14: Unknown variable cast_type

Edited by stumlehb, 30 January 2012 - 08:39 PM.

  • 0

#71 rude guss

rude guss

    GMC Member

  • GMC Member
  • 235 posts

Posted 31 January 2012 - 01:04 AM


BIIIIIIG Update! Includes: hotkey system, stunning, silencing and more! check out the first post for more info. Added plenty of new pictures showcasing the new features. How-To Guide will also be updated soon as well.


It is looking good.
I've noticed a minor bug. The unit will not display while the direction is 0.
So in the draw event of obj_unit_template, this:
if (direction > 332 && direction < 360) or (direction > 0 && direction < 22) {draw_sprite(state_anim[state,2],-1,x,y);}
should be changed to this:
if (direction > 332 && direction < 360) or (direction >= 0 && direction < 22) {draw_sprite(state_anim[state,2],-1,x,y);}


Also, got this error when casting chain lightning, but couldn't reproduce it when trying again:
ERROR in
action number 1
of Step Event
for object obj_unit_template:

Error in code at line 524:
switch (cast_type)
^
at position 14: Unknown variable cast_type


Ah, Thank you so much for finding those bugs. I have fixed the first one. The second one - There was a typo in the initialisation of that variable in obj_unit_template. See in the create event:

/*var*/ cast_taype = 99;

just remove the 'a' and then that error should never pop up ever again.

Thanks again!!
  • 0

#72 Icetec1337

Icetec1337

    GMC Member

  • New Member
  • 2 posts
  • Version:GM8

Posted 27 February 2012 - 01:02 AM

Just to clarify, enemy units are the same as player ones in terms of mechanics, right? Or are there any differences I should know about? Also, the tutorial doesn't say anything about enemies.
  • 0

#73 Icetec1337

Icetec1337

    GMC Member

  • New Member
  • 2 posts
  • Version:GM8

Posted 27 February 2012 - 01:04 AM

Is it possible to make the standing animation to animate? for example if i want the person to blink or something else.

Yes. it has to be pretty long though depending on how often they blink.
  • 0

#74 rude guss

rude guss

    GMC Member

  • GMC Member
  • 235 posts

Posted 27 February 2012 - 05:42 AM

Just to clarify, enemy units are the same as player ones in terms of mechanics, right? Or are there any differences I should know about? Also, the tutorial doesn't say anything about enemies.


Yep, the parent object they use is a copy of the ally unit parent, with a few variable values changed - such as which unit they will target. What questions do you have about enemy units?
  • 0

#75 seZereth

seZereth

    GMC Member

  • GMC Member
  • 35 posts
  • Version:GM8

Posted 27 March 2012 - 08:57 PM

Hey guys,
has anyone found a good solution for the movement bug, when move_x and move_y is inside a solid object, the units will never reach move_x/y and thus walk around stupidly without end.
It is pretty annoying, and there has to be a simple solution for this.
I love the advanced movement, when you have selected more than 1 unit, it looks awesome. but it makes the bug even more pronounced, as it is possible that the row and column operation assigns a move_x and move_y inside a solid object (especially in my case, where I use lots of cover).

I tried the following in the step event:

if able_to_move = true || gathering = true
{
if position_meeting(move_x,move_y,obj_solid_parent)
{
able_to_move = true;
move_x = move_x + random(16) - random(16);
move_y = move_y + random(16) - random(16);
}
}

in my eyes this piece of code should generate new move_x and move_y coordinates until it found one which is not inside a solid object (child of obj_parent_solid).
am I missing something???
  • 0

#76 stumlehb

stumlehb

    GMC Member

  • GMC Member
  • 197 posts

Posted 28 March 2012 - 07:59 PM

Do you mean when you tell them to go to a solid rock, they just walk in circles around it instead of stopping next to it? I didn't think that was a bug, I kind of liked it.. Or are you talking about when they occasionally walk extra fast in random directions ignoring the locations of enemy targets? Regarding your code fix... I wonder if you could make a temporary non-solid target object when you click.. replace move_x/move_y with target_object.x/target_object.y, and just move the target object outside of the solid when it's created, or during the step event if you also want to make the target_object follow other units, so you can make 'following' or 'guard' buttons.

I was having another problem with collisions, where the unit would get stuck in one location in an animated walking state next to solid objects, for the most part losing control of that unit, but if I were to click on the insertion point pixel of the unit, it would break free .... It's because I used some different mp potential settings to avoid having the units spin around all the time.. So I just added some code saying that if the unit was in the walking state while in the same location for more than a certain amount of time, it should change it's direction + or - 45 degrees depending on what its current direction is.. That solved the collision problem..

Does anybody know how to make a better fog of war for this engine? the current one seems to jump around during scrolling and seems a bit blocky..

Hey guys,
has anyone found a good solution for the movement bug, when move_x and move_y is inside a solid object, the units will never reach move_x/y and thus walk around stupidly without end.
It is pretty annoying, and there has to be a simple solution for this.
I love the advanced movement, when you have selected more than 1 unit, it looks awesome. but it makes the bug even more pronounced, as it is possible that the row and column operation assigns a move_x and move_y inside a solid object (especially in my case, where I use lots of cover).

I tried the following in the step event:

if able_to_move = true || gathering = true
{
if position_meeting(move_x,move_y,obj_solid_parent)
{
able_to_move = true;
move_x = move_x + random(16) - random(16);
move_y = move_y + random(16) - random(16);
}
}

in my eyes this piece of code should generate new move_x and move_y coordinates until it found one which is not inside a solid object (child of obj_parent_solid).
am I missing something???


Edited by stumlehb, 28 March 2012 - 08:13 PM.

  • 0

#77 seZereth

seZereth

    GMC Member

  • GMC Member
  • 35 posts
  • Version:GM8

Posted 29 March 2012 - 11:04 AM

Well, the guard or patrol function does work without the target_object. And somehow I like the simple approach of the move_x and move_y coordinates, as it opens some other possibilities (and you wonīt create a new target_object for each unit moving).

I use this code now:
                var col;
                col=collision_circle(move_x,move_y,8,obj_solid_parent,1,1);
                if col 
                {
                move_x+=random(16)-random(32)
                move_y+=random(16)-random(32)
                }
It works in 80% of the time, only sometimes units tend to get stuck. It still does not work good for large areas of solid blocks. but on the other hand, why should you send your units there and expect them to not run around trying to reach the point? players arenīt that stupid i think.

A bit annoying is implementing "shooting while running", as I will have to create another state and fix the code for that :/

What would be really interesting to see, is if someone implemented Multiplayer already?
Iīm still adding new mechanics (next big thing is AI), but nothing too complicated and I would love to be able to play it in Multiplayer and consider what and where I will have to add mplay specific commants, before I create all my actual units, etc.
As I had only a quick look at Multiplayer functions, I am still a bit overwhelmed by the idea, that I have to add lots of data sending commants from and to clients :/
Maybe someone who already worked on this can take away my fear and convince me that it is pretty easy to do?! or show me an example file for a multiplayer rts?

Do you mean when you tell them to go to a solid rock, they just walk in circles around it instead of stopping next to it? I didn't think that was a bug, I kind of liked it.. Or are you talking about when they occasionally walk extra fast in random directions ignoring the locations of enemy targets? Regarding your code fix... I wonder if you could make a temporary non-solid target object when you click.. replace move_x/move_y with target_object.x/target_object.y, and just move the target object outside of the solid when it's created, or during the step event if you also want to make the target_object follow other units, so you can make 'following' or 'guard' buttons.

I was having another problem with collisions, where the unit would get stuck in one location in an animated walking state next to solid objects, for the most part losing control of that unit, but if I were to click on the insertion point pixel of the unit, it would break free .... It's because I used some different mp potential settings to avoid having the units spin around all the time.. So I just added some code saying that if the unit was in the walking state while in the same location for more than a certain amount of time, it should change it's direction + or - 45 degrees depending on what its current direction is.. That solved the collision problem..

Does anybody know how to make a better fog of war for this engine? the current one seems to jump around during scrolling and seems a bit blocky..


Hey guys,
has anyone found a good solution for the movement bug, when move_x and move_y is inside a solid object, the units will never reach move_x/y and thus walk around stupidly without end.
It is pretty annoying, and there has to be a simple solution for this.
I love the advanced movement, when you have selected more than 1 unit, it looks awesome. but it makes the bug even more pronounced, as it is possible that the row and column operation assigns a move_x and move_y inside a solid object (especially in my case, where I use lots of cover).

I tried the following in the step event:

if able_to_move = true || gathering = true
{
if position_meeting(move_x,move_y,obj_solid_parent)
{
able_to_move = true;
move_x = move_x + random(16) - random(16);
move_y = move_y + random(16) - random(16);
}
}

in my eyes this piece of code should generate new move_x and move_y coordinates until it found one which is not inside a solid object (child of obj_parent_solid).
am I missing something???


  • 0

#78 stumlehb

stumlehb

    GMC Member

  • GMC Member
  • 197 posts

Posted 29 March 2012 - 04:18 PM

There was a GM multiplayer rts called dark hive.. if you can't find it online, PM me and I can send the source to your e-mail or something. It didn't look like the multiplayer code was too complicated, but that rts was built a bit differently ... if you get it working, let me know how to do it.. I've been too busy with graphics ..

it would be interesting to see what you have so far on your rts. mechanics and ai and stuff. I've plugged some topdown ai into this engine semi-successfully with some modification, but it's not where it should be yet...

Shooting while running could be done a couple different ways.. you can have separate sprites for legs, standing/moving, then draw the torso on top of them standing/attacking/moving ... I'm doing something similar to get random unit appearance(different heads, etc.) or as you say just add a new running while attacking state.


Well, the guard or patrol function does work without the target_object. And somehow I like the simple approach of the move_x and move_y coordinates, as it opens some other possibilities (and you won´t create a new target_object for each unit moving).

I use this code now:

                var col;
                col=collision_circle(move_x,move_y,8,obj_solid_parent,1,1);
                if col 
                {
                move_x+=random(16)-random(32)
                move_y+=random(16)-random(32)
                }
It works in 80% of the time, only sometimes units tend to get stuck. It still does not work good for large areas of solid blocks. but on the other hand, why should you send your units there and expect them to not run around trying to reach the point? players aren´t that stupid i think.

A bit annoying is implementing "shooting while running", as I will have to create another state and fix the code for that :/

What would be really interesting to see, is if someone implemented Multiplayer already?
I´m still adding new mechanics (next big thing is AI), but nothing too complicated and I would love to be able to play it in Multiplayer and consider what and where I will have to add mplay specific commants, before I create all my actual units, etc.
As I had only a quick look at Multiplayer functions, I am still a bit overwhelmed by the idea, that I have to add lots of data sending commants from and to clients :/
Maybe someone who already worked on this can take away my fear and convince me that it is pretty easy to do?! or show me an example file for a multiplayer rts?


Edited by stumlehb, 29 March 2012 - 04:19 PM.

  • 0

#79 ongik

ongik

    GMC Member

  • New Member
  • 3 posts
  • Version:GM8

Posted 28 June 2012 - 11:06 PM

Thank you for your hard work on the engine and instruction.
  • 0

#80 rude guss

rude guss

    GMC Member

  • GMC Member
  • 235 posts

Posted 01 July 2012 - 05:33 AM

Thank you for your hard work on the engine and instruction.


No problem mate!
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users