Author Topic: [READY TO TEST in 3.3.7-dev] max_unit_count limit  (Read 1723 times)

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
[READY TO TEST in 3.3.7-dev] max_unit_count limit
« on: 18 August 2010, 08:50:04 »
HI I'm currently adding a new attribute to MG's unit xml description.
Its called max_unit_count and is used to give a limit how many units of this kind can be produced. This is typically useful for heroes or gods where you can only have one of .
I know this behaviour can be faked with new ressources and so on, but its not really the same. ( imagine you have 10 heroes so you need 10 ressources to make it work ). Its build in now and works and the AI also knows how to handle it, but:

How do I show these limits to a user?
Requirements and unit costs are usually displayed when you hold the mouse over a produce icon for example. Other Attributes of a unit are only shown if a unit already exists and you select it. But this new attribute is different, its somehow a requirement and somehow an attribute of the unit.

My only idea is to add a new "section" under requirements and show it there. But how do I call it?
(By the way, changes are only on my local copy, its not in svn yet )
« Last Edit: 31 August 2010, 07:05:31 by titi »
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

Yggdrasil

  • GAE Team
  • Ornithopter
  • ********
  • Posts: 408
    • View Profile
Re: new max_unit_count limit, how to display in user interface?
« Reply #1 on: 18 August 2010, 09:40:20 »
It's definitely a requirement. It's of no interest when you select a unit, only when you want to build/train one.

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: new max_unit_count limit, how to display in user interface?
« Reply #2 on: 18 August 2010, 11:28:53 »
yes true, but it has another logic:

A typical requirements is:
blacksmith

which means a blacksmith is needed to do this action. But when I write there:

max unit count  5

which means a maximum of 5 units of this type is allowed.
This is some kind of limit not really a requirement. But maybe I'm too picky here.

Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

tomreyn

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 2,764
    • View Profile
    • MegaGlest - the free and open source cross platform 3D real-time strategy game
Re: new max_unit_count limit, how to display in user interface?
« Reply #3 on: 18 August 2010, 13:16:52 »
I'd just add a new section below the existing 'requirements' section called 'limits' and add it there. Since there could be additional limitations in the future and it is not really a 'requirement' I think it should not be listed in the same place.
« Last Edit: 31 August 2010, 12:03:09 by tomreyn »
atibox: Ryzen 1800X (8 cores @3.6GHz), 32 GB RAM, MSI Radeon RX 580 Gaming X 8G, PCI subsystem ID [1462:3417], (Radeon RX 580 chipset, POLARIS10) @3440x1440; latest stable Ubuntu release, (open source) radeon (amdgpu) / mesa video driver
atibox (old): Core2Quad Q9400 (4 cores @2.66GHz), 8 GB RAM, XFX HD-467X-DDF2, PCI subsystem ID [1682:2931], (Radeon HD 4670, RV730 XT) @1680x1050; latest stable Ubuntu release, (open source) radeon / mesa video driver
notebook: HP envy13d020ng
internet access: VDSL2+

· · · How YOU can contribute to MG · Latest development snapshot · How to build yourself · Megapack techtree · Currently hosted MG games · · ·

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: [READY TO TEST in 3.3.7-dev] max_unit_count limit
« Reply #4 on: 31 August 2010, 07:10:14 »
ok its in there now, please test it.

just put this in your unit description and you will only be able to build 2 units of this type:
<max-unit-count value=2/>

like this:
Code: [Select]
<?xml version="1.0" standalone="no"?>

<unit>
<parameters>
<size value="1"/>
<height value="2"/>
<max-hp value="900"  regeneration="0"/>
<max-ep value="0"/>
<max-unit-count value=2/>
<armor value="40"/>
<armor-type value="metal"/>
<sight value="10"/>
<time value="80"/>
« Last Edit: 1 September 2010, 21:55:33 by titi »
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

Psychedelic_hands

  • Guest
Re: [READY TO TEST in 3.3.7-dev] max_unit_count limit
« Reply #5 on: 31 August 2010, 09:41:26 »
Awesome  ;D This will be handy.

silnarm

  • GAE Team
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: [READY TO TEST in 3.3.7-dev] max_unit_count limit
« Reply #6 on: 1 September 2010, 02:08:07 »
Nice. Before it comes out in an official release, any chance you could make it "max-unit-count" to be consistent in style... I know I'm already to late for teamcolorEnergy, but if you could avoid added a third different naming style, it would probably be for the best ...
Glest Advanced Engine - Code Monkey

Timeline | Downloads

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: [READY TO TEST in 3.3.7-dev] max_unit_count limit
« Reply #7 on: 1 September 2010, 14:01:17 »
oh yes, thats true, I will do it.  Thanks for mentioning this.

( update:  it was max-unit-count, the only place I did it wrong was the forum :) , I corrected the above)
« Last Edit: 1 September 2010, 21:56:11 by titi »
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

emscape

  • Guest
Re: [READY TO TEST in 3.3.7-dev] max_unit_count limit
« Reply #8 on: 8 September 2010, 16:54:36 »
THANK U SOOOOOO MUCH FOR THIS! THIS WAS WHAT I NEEDED!

 

anything