Page 1 of 1

Spawning troops (Campaings)

PostPosted: 02 Jan 2015, 23:45
by Papundekl
Hi,
I would like to start discusion about spawning troops (in campaigns). Especially after campaign misson - An Empire Destroyed [9].
This message is not just for Campaing designers ;]

I understand, spawning troops is easy way for creating scenarios etc. and its harder for players. But there should be some "standard" or some realistic rule for spawning troops in campaings.
Its really stupid when the enemies troops are generated near to your city. Its acceptable in special missions or when you have chance to see they are coming, but this...

I dont like it. Why?
There were balistas and catapults in KaM TPR and they were removed in Remake because:
Cite FAQ: “magically” drives with nobody pushing or pulling. it In KaM every tiny detail is visible .... "
So why is acceptable to spawn troops with no obvious reason few tiles from my city? Just build some small enemy base or "bridge from map edge" and spawn troops on this location, not randomly near to my location.

I like harder missons, but be more "realistic" in this way...

Re: Spawning troops (Campaings)

PostPosted: 03 Jan 2015, 06:57
by dicsoupcan
i never bought the realistic argument for anything in videogames. the mission is set up to have economical goals and to challenge you a bit more small raid armies come. you can easily spot them and prepare a defense against them. at best they should just be a minor hinderance.

if you do not like the mission you are entitled to voice it, but i'm not falling for the not realistic argument. the only thing that will change is the bugfix of the win condition, and that's ti.

Re: Spawning troops (Campaings)

PostPosted: 03 Jan 2015, 07:20
by Lewin
I think it's a lot better if enemies spawn at the edge of the map like Papundekl suggested. Ideally they should spawn out of the sight of the player (somewhere the player is unlikely to have explored). Even if you don't think realism matters, enemies spawning away from the edges of the map is unexpected and unpredictable. It's hard for the player to set up defenses when they are know that enemy soldiers can spawn anywhere. In most other RTS games reinforcements come from the edges of the map, so players will probably already be expecting to see that.

Also, realism does matter, at least to a certain extent. The game is based off a real world situation which makes it more interesting for the player (they can relate to it), and they can predict how the game will work based on their knowledge of the real world and medieval times (e.g. flour is made into bread at the bakery). If we completely throw away realism we might as well have pink elephants firing missiles appear in the campaign, and have the baker catch fish that grow in trees while the fisherman cooks stone into loaves of bread.

But obsessing over realism is also unproductive (e.g. soldiers should be drunk after drinking wine). It's fine to bend realism in a game while still having it heavily based off the real world.

Re: Spawning troops (Campaings)

PostPosted: 03 Jan 2015, 08:06
by sado1
(...)we might as well have pink elephants firing missiles appear in the campaign, and have the baker catch fish that grow in trees while the fisherman cooks stone into loaves of bread.

But obsessing over realism is also unproductive (e.g. soldiers should be drunk after drinking wine). It's fine to bend realism in a game while still having it heavily based off the real world.
Congratulations, you did the impossible and convinced me, a single player mode hater, to make a campaign. Do you want to know what kind of elephants will be included in it? :P

Re: Spawning troops (Campaings)

PostPosted: 03 Jan 2015, 10:40
by zombie01
Would it be possible to add 2 functions?
1. makes troops/minions walk in from outside the map
2. makes troops/minions walk out of a building

That way it solves the spawning troops problem

Re: Spawning troops (Campaings)

PostPosted: 03 Jan 2015, 11:34
by Krom
How about enclosed area on the map, where player can not enter and which is covered with fog of war, from where AI troops can spawn?

Re: Spawning troops (Campaings)

PostPosted: 03 Jan 2015, 11:40
by T*AnTi-V!RuZz
How about enclosed area on the map, where player can not enter and which is covered with fog of war, from where AI troops can spawn?
I like zombie's idea better. It adds to the feeling of the game, that (for example) allies arrive from another part to help you out. I always liked that in other games, instead of just 'popping' them into view. Using FoW may be a solution to that, but I still think that's a workaround for a neat solution.

Re: Spawning troops (Campaings)

PostPosted: 03 Jan 2015, 11:56
by Esthlos
1. makes troops/minions walk in from outside the map
Not really "walk in", but this code does something pretty close to that (it spawns groups one row at a time from an edge... not necessarily the map's edge):
  Code:
const aEdgeSpawnRate = 20; //How many ticks need to pass before the next row spawns. var aEdgeSpawnQueue: array of Record aGroupID, aPlayer, aType, aX, aY, aDir, aColumns, aStage: Integer; end; type tEdge = (South, SouthEast, East, NorthEast, North, NorthWest, West, SouthWest); //From where is the troop arriving //To be placed OnTick procedure aManageSpawnFromEdge; var i: Integer; var i2: Integer; var iCount: Integer; var aNewGroup: Integer; begin if Length(aEdgeSpawnQueue) > 0 then begin iCount := 0; for i := 0 to Length(aEdgeSpawnQueue)-1 do begin aEdgeSpawnQueue[i-iCount].aStage := aEdgeSpawnQueue[i-iCount].aStage-1; if aEdgeSpawnQueue[i-iCount].aStage <= 0 then if States.UnitAt(aEdgeSpawnQueue[i-iCount].aX, aEdgeSpawnQueue[i-iCount].aY) > 0 then aEdgeSpawnQueue[i-iCount].aStage := 1; if aEdgeSpawnQueue[i-iCount].aStage <= 0 then begin aNewGroup := Actions.GiveGroup(aEdgeSpawnQueue[i-iCount].aPlayer, aEdgeSpawnQueue[i-iCount].aType, aEdgeSpawnQueue[i-iCount].aX, aEdgeSpawnQueue[i-iCount].aY, aEdgeSpawnQueue[i-iCount].aDir, 1, 1); if States.GroupDead(aEdgeSpawnQueue[i-iCount].aGroupID) = False then Actions.GroupOrderLink(aNewGroup, aEdgeSpawnQueue[i-iCount].aGroupID); if States.GroupDead(aEdgeSpawnQueue[i-iCount].aGroupID) = True then for i2 := i-iCount+1 to Length(aEdgeSpawnQueue)-1 do if aEdgeSpawnQueue[i2].aGroupID = aEdgeSpawnQueue[i-iCount].aGroupID then aEdgeSpawnQueue[i2].aGroupID := aNewGroup; for i2 := i-iCount to Length(aEdgeSpawnQueue)-2 do aEdgeSpawnQueue[i2] := aEdgeSpawnQueue[i2+1]; iCount := iCount+1; end; end; if iCount > 0 then SetLength(aEdgeSpawnQueue, Length(aEdgeSpawnQueue)-iCount); end; end; //To be used instead of Actions.GiveGroup function aSpawnFromEdge(aPlayer, aType, aX, aY, aCount, aColumns: Integer; aEdge: tEdge): Integer; var i: Integer; var iX: Integer; var iY: Integer; var iDir: Integer; var iVar: Integer; var iStage: Integer; var iCount: Integer; begin case aEdge of South: iDir := 0; //SouthEast: iDir := 7; East: iDir := 6; //NorthEast: iDir := 5; North: iDir := 4; //NorthWest: iDir := 3; West: iDir := 2; //SouthWest: iDir := 1; else Exit; //Other directions not supported yet end; i := 1; if iDir mod 2 = 0 then i := aColumns; result := Actions.GiveGroup(aPlayer, aType, aX, aY, iDir, i, aColumns); iCount := aCount-i; if iCount > 0 then begin SetLength(aEdgeSpawnQueue, Length(aEdgeSpawnQueue)+iCount); for i := 0 to iCount-1 do begin iVar := (i mod aColumns)-((aColumns-(aColumns mod 2))/2); case aEdge of South: begin iX := aX+iVar; iY := aY; end; //SouthEast: begin //end; East: begin iX := aX; iY := aY+iVar+((aColumns+1) mod 2); end; //NorthEast: begin //end; North: begin iX := aX+iVar+((aColumns+1) mod 2); iY := aY; end; //NorthWest: begin //end; West: begin iX := aX; iY := aY+iVar; end; //SouthWest: begin //end; end; iStage := (((i-(i mod aColumns))/aColumns)+1)*aEdgeSpawnRate; if iX <= 0 then iX := 1; if iY <= 0 then iY := 1; if iX >= States.MapWidth then iX := States.MapWidth-1; if iY >= States.MapHeight then iY := States.MapHeight-1; aEdgeSpawnQueue[Length(aEdgeSpawnQueue)-i-1].aGroupID := result; aEdgeSpawnQueue[Length(aEdgeSpawnQueue)-i-1].aPlayer := aPlayer; aEdgeSpawnQueue[Length(aEdgeSpawnQueue)-i-1].aType := aType; aEdgeSpawnQueue[Length(aEdgeSpawnQueue)-i-1].aX := iX; aEdgeSpawnQueue[Length(aEdgeSpawnQueue)-i-1].aY := iY; aEdgeSpawnQueue[Length(aEdgeSpawnQueue)-i-1].aDir := iDir; aEdgeSpawnQueue[Length(aEdgeSpawnQueue)-i-1].aColumns := aColumns; aEdgeSpawnQueue[Length(aEdgeSpawnQueue)-i-1].aStage := iStage; end; end; end;
Here's AED09's script with a bugfix and with this code being used:
Script
2. makes troops/minions walk out of a building
Already asked Lewin to add this... I've even already written, tested and PMed him the code needed, it only needs him to come back from vacation and check it up :P

Re: Spawning troops (Campaings)

PostPosted: 03 Jan 2015, 13:35
by dicsoupcan
I think it's a lot better if enemies spawn at the edge of the map like Papundekl suggested. Ideally they should spawn out of the sight of the player (somewhere the player is unlikely to have explored). Even if you don't think realism matters, enemies spawning away from the edges of the map is unexpected and unpredictable. It's hard for the player to set up defenses when they are know that enemy soldiers can spawn anywhere. In most other RTS games reinforcements come from the edges of the map, so players will probably already be expecting to see that.

Also, realism does matter, at least to a certain extent. The game is based off a real world situation which makes it more interesting for the player (they can relate to it), and they can predict how the game will work based on their knowledge of the real world and medieval times (e.g. flour is made into bread at the bakery). If we completely throw away realism we might as well have pink elephants firing missiles appear in the campaign, and have the baker catch fish that grow in trees while the fisherman cooks stone into loaves of bread.

But obsessing over realism is also unproductive (e.g. soldiers should be drunk after drinking wine). It's fine to bend realism in a game while still having it heavily based off the real world.
i can imagine that some people do not like it, but it is not really unreal to do it this way. otherwise we could delete furious warriors where warriors randomly spawn and buildings magically build themselves, or the conquest where weapons magically spawn, or AED08 where you teleport stone and your ally teleports random goods into your market.

Well i'll see what Esthlos modified in the script, it needed a bugfix anyway ^^, but i just wanted to make a point about the realism here.

but if you dislike this mechanic rejoice, chapter 2 has no mission that contains this and there is no plan to include such a mission in there :)

Re: Spawning troops (Campaings)

PostPosted: 05 Jan 2015, 11:07
by Tiank as guest
i can imagine that some people do not like it, but it is not really unreal to do it this way. otherwise we could delete furious warriors where warriors randomly spawn and buildings magically build themselves, or the conquest where weapons magically spawn
It's different when it comes to unique game modes, where such a script magic is allowed to generate more fun and it's different in campaigns, where there's a story and you get deeper into it and then realistic factor is important :).