Author Topic: Point Capturing  (Read 3304 times)

divineauthority

  • Guest
Point Capturing
« on: 25 February 2008, 20:07:45 »
I was just wondering if there is any easy(ish) method of making buildings that can be captured and would from that produce bonus resources etc. These would then be fought over by the forces engaged in the battle.

I'm guessing this would have to be coded in using C++, if so has anybody else had a go at this kind of thing?

Thanks in advance.
« Last Edit: 1 January 1970, 00:00:00 by divineauthority »

daniel.santos

  • Guest
(No subject)
« Reply #1 on: 26 February 2008, 07:48:47 »
That sounds fun!  Like a bit of a capture the flag feel huh?

Yea, that would take a fair amount of coding, you would probably have to implement an alternate set of game rules.  First off, buildings belong to a faction (a team).  There is no current way for buildings to be un-owned.  The quick & dirty hack would be to create a 5th "nobody" team, add these "unowned" units to that team and then have a mechanism to exchange ownership.  But even that isn't quite enough because the behavior of your units will be to destroy the units belonging to another team.  So yea, it would be a lot of work, but that could be a fun twist on the standard player vs player game.
« Last Edit: 1 January 1970, 00:00:00 by daniel.santos »

divineauthority

  • Guest
(No subject)
« Reply #2 on: 26 February 2008, 17:16:31 »
:( I've not done any C++ before so I wouldn't know where to start, the closest thing to coding I've done is a fair bit of ActionScripting in Flash.

Another problem I could see is that if a building is captured then even if its set to invulnerable health, the one teams units are going to try and attack it, forever and ever and ever etc.
« Last Edit: 1 January 1970, 00:00:00 by divineauthority »

ttsmj

  • Guest
(No subject)
« Reply #3 on: 26 February 2008, 18:31:50 »
when building is destroyed, its hp will be restored to full and the unit that make most damage? last hit? would became the owner..
« Last Edit: 1 January 1970, 00:00:00 by ttsmj »

divineauthority

  • Guest
(No subject)
« Reply #4 on: 26 February 2008, 21:01:22 »
Is this possible without C++?

Also would it be possible to make it only applicable to close combat weapons so that you cant steal a building from 800 yards?

[EDIT] This last point's ok as the way my armour and damage tyes are set up i could set up a new armour class for this type of building and set it so only the melee damages do any damage to it.
« Last Edit: 26 February 2008, 22:18:17 by divineauthority »

Duke

  • Guest
(No subject)
« Reply #5 on: 26 February 2008, 22:11:24 »
Daniel is working on ways to interact with objects (to make a Treant out of a tree or to clear a path through the forest etc.)

Maybe this could be used here too. Let's say object 10 is an abandonned outpost and every faction could develop it into its own kind of oupost and if that one gets destroyed it degenerates to the abandonned version again.
« Last Edit: 1 January 1970, 00:00:00 by Duke »

divineauthority

  • Guest
(No subject)
« Reply #6 on: 26 February 2008, 22:25:18 »
Ah I remember reading about the treants thing.

Does anybody know how the possession of buildings is dealt with? As in, how does the PC know that the barracks is mine and not the AI's?

Would it be possible to set a condition that when destroyed, the building changes possession? (Of course, like this it would only be suitable for 2 player maps, unless there's a way to find out who caused the damage. This, in my circumstances, is ok for now)
« Last Edit: 1 January 1970, 00:00:00 by divineauthority »

daniel.santos

  • Guest
(No subject)
« Reply #7 on: 1 March 2008, 03:23:36 »
Well, 1st off, it's not possible without changes to the C++ code.  My initial thought is that these capturable units (buildings) could be specified in a secondary file, separate from the map, but with information to match each map.  Perhaps the easiest way would be a single xml file that tells the details of these capturable units and specifies where they are in each map.  The alternative of modifying each map personally seems more daunting to me.

As far as the mechanism for implementing this...
First off, there is a hard set limit of 4 teams (called factions internally).  This is actually modifiable from a single variable in the code unless I'm mistaken.  But I'm not entirely certain what the best approach would be to archive this.  As I mentioned before, the quick & dirty approach is to make them belong to a 5th team, but there may be a better way to go about it, especially since the changes needed to do this wouldn't be so "quick" anyway.

The questions should be asked:
  • What would be required to capture one of these units?
  • What would other mods want to set as requirements for capturing one of these units?
  • Could there be other means to capture alternate units?  Maybe some units are captured by destroying them and doing the most damage.  Maybe other units are captured by having a unit from your team execute a "capture" command on them and that command takes x amount of time.  This gives rivals a time window in which to kill your unit that's trying to capture.
  • How will the captured unit behave once it's captured?
  • Should you be able to repair a captured unit that you own?
  • Should there be a global notice when somebody begins the attempt to capture one of these units?
  • Do you want this to work from any tech tree mod (magitech, four path magitech, indians, etc.) or just one that you create especially for this purpose?
  • If the former, are you proposing that Glest have a "game type" that you specify when starting a game where there's a "normal" player-vs-player and then a "capture" game type?

I think that having a scripting language may aid in doing this, but I'm not at a point where I'm seriously looking at that since I was able to get everything to work (thus far) in our mod without it.  Also, if you want it to work cross-mods, then you should ideally have models (animations) and sounds that fit with the theme of each mod.  You can do this cheaply by reusing a model from one of their mods, but having a unique one would be better.  That part isn't crucial however, it would just make it look better.
« Last Edit: 1 January 1970, 00:00:00 by daniel.santos »

divineauthority

  • Guest
(No subject)
« Reply #8 on: 1 March 2008, 12:21:43 »
What would be required to capture one of these units?

Well the capture command you suggest in my opinion would be the best way of doing it.

How will the captured unit behave once it's captured?

Well I was thinking that these points would be places of importance with regards to strategic advantages or resources. So they'd be things such as buildings. Therefore once captured they wouldn't have to do anything except sit there and look pretty.

Should you be able to repair a captured unit that you own?

Well if the capture command could be implemented then the points should be invincible. If this idea were implemented through the use of damaging buildings then I reckon you should be able to repair.

Should there be a global notice when somebody begins the attempt to capture one of these units?

That's an interesting idea, especially if there were a gametype when yo'ud win by capturing a specfic point. I don't think this is something overly important though.

Do you want this to work from any tech tree mod (magitech, four path magitech, indians, etc.) or just one that you create especially for this purpose?

I think there might be a few people who'd like this kind of gameplay so if it were useable by any mod that'd be great.

If the former, are you proposing that Glest have a "game type" that you specify when starting a game where there's a "normal" player-vs-player and then a "capture" game type?

That'd be funky!
« Last Edit: 1 January 1970, 00:00:00 by divineauthority »

wciow

  • Behemoth
  • *******
  • Posts: 968
    • View Profile
(No subject)
« Reply #9 on: 1 March 2008, 16:16:53 »
When I first saw this topic I thought that the best way to implement capturable points would be a tweak to the resources.

* Resources can already be placed precisely on a map, buildings and units can't.

* Resources are not owned by any team or player.

* Resources already give points to players.

* Resources can have any model associated with them.

To make capturable points you would just have to implement some code where a certain unit is able to make a point owned by a team.

This would best be defined at the tech tree level since resources are a part of the tech tree. Thus by simply selecting the tech tree in-game you can have capturable resources.

I don't know anything about how the engine works on a C level so maybe the way that Daniel has already talked about is easier, but from a layman's point of view this seems like a workable idea.
« Last Edit: 1 January 1970, 00:00:00 by wciow »
Check out my new Goblin faction - https://forum.megaglest.org/index.php?topic=9658.0

Duke

  • Guest
(No subject)
« Reply #10 on: 2 March 2008, 00:18:13 »
Well, I don't now C either, but i now a little bit about programming in general and it is usually a good aproach to have new features based on stuff you already have instead of creating something entirely new.
 And as Daniel said himself his aproach is rather dirty and if it is easy at all is questionable.

Glest uses only two resources, but 5 are definable on maps and I'm pretty sure that amount is variable.

And it would be probably best to define capturable units as recources in the techtree.
So tilesets are entrirely seperate and all techtrees can still be played on all maps. If you have a normal tech, the capture recources on a map are just ignored and if you have a capture tech on a normal map, there just are no capturable units.

And as I said above, GAP is probably going to have an option to convert resources directly into units, and vice versa. And the Lich is supposed to be able to capture enemy units. I think with these options it would be posible to create any capturing mechnism desirable.

I think creating a second gametype that would work with all mods is not realisable, because all factions are different and they would need some definition of how they could fit the captured unit into their own tech tree.
That would probably work only for the special type "capture the flag", where the capture itself actually ends the game.
« Last Edit: 1 January 1970, 00:00:00 by Duke »

divineauthority

  • Guest
(No subject)
« Reply #11 on: 2 March 2008, 16:44:14 »
So really there isn't going to be a "simple" (relatively speaking) way of implementing this. Just in case my original point has been confused, the closest thing I've found to it is Dawn Of War which pretty much has exactly the kind of thing Im after.
« Last Edit: 1 January 1970, 00:00:00 by divineauthority »