Author Topic: Could units have morale  (Read 2175 times)

wyvern

  • Guest
Could units have morale
« on: 15 April 2010, 16:27:59 »
I'm trying to make units with the ability to run away if their fear points get too high. In addition to hp and ep their could be fp for fear points. Every unit would flee once their fp hit a certain point which would vary by unit also different units would cause different amounts of fp with their attacks.

Fluffy203

  • Guest
Re: Could units have morale
« Reply #1 on: 15 April 2010, 23:48:33 »
With programming anything is possible  8)

ElimiNator

  • Airship
  • ********
  • Posts: 3,391
  • The MegaGlest Moder.
    • View Profile
Re: Could units have morale
« Reply #2 on: 16 April 2010, 07:48:11 »
Yah, but would every one want that?
Get the Vbros': Packs 1, 2, 3, 4, and 5!

wyvern

  • Guest
Re: Could units have morale
« Reply #3 on: 16 April 2010, 13:57:40 »
Well I'm thinking some units could be fearless and unaffected by fp. It would also open the way for a unit like a ringwraith :D :D :D

silnarm

  • Local Moderator
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: Could units have morale
« Reply #4 on: 16 April 2010, 14:00:25 »
  Unfortunately I don't see a way to do it now, if the AI/Auto-commands were smarter it could work by removing their ability to attack, but they aren't smart, and the current effect/enhancement/upgrade mechanism is poorly integrated with the AI.

  The 'ultimate idea' from our perspective is to have stats such as these be 'local resources'.  A unit would have 'hit-points' in most every case, energy/mana if appropriate, 'fuel', etc, as the mod demands. 'morale' requires some modification of typical behaviour, hit-points: dead/alive, mana/fuel: can do something / can't. Morale affects the way updates to commands are applied, and we hope in time to be able to do this kind of thing by having commands updated in Lua, which would make exactly this kind of thing very possible (and much more).  But we don't even know if that is feasible (in terms of performance) at this stage.

NB: It could be done in a scenario now with some clever scripting.

Cheers.

Glest Advanced Engine - Code Monkey

Timeline | Downloads

jda

  • Guest
Re: Could units have morale
« Reply #5 on: 16 April 2010, 23:17:04 »
I'm trying to make units with the ability to run away if their fear points get too high. In addition to hp and ep their could be fp for fear points. Every unit would flee once their fp hit a certain point which would vary by unit also different units would cause different amounts of fp with their attacks.
I would rather have an unit attacked be affected other than just loosing HP (or gaining fear) like loosing attack damage points and speed, walk speed, that kind of stuff... ;)

@ silnarm
I did wonder about that Lua AI coding, when you first mentioned it (that I saw) a while ago, whether an interpreted language would be fast enough to deal with possibly hundreds and even thousands of units at the same time, further more that giving us mere mortals (non coding modders) that kind of power might very well make us abuse it... You get what I mean... over do it and blame the slowness on the engine...  :O
D*mn, I'm good at motivating people! LOL
But that Lua AI'ing would be awesome!  8) :thumbup:

silnarm

  • Local Moderator
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: Could units have morale
« Reply #6 on: 18 April 2010, 07:45:17 »
@ silnarm
I did wonder about that Lua AI coding, when you first mentioned it (that I saw) a while ago, whether an interpreted language would be fast enough to deal with possibly hundreds and even thousands of units at the same time, ...

We will see. Lua isn't actually 'interpreted' in the traditional sense, it is compiled as it's loaded, into a bytecode, much like Java or CLR apps. So it performs fairly well... unfortunately, as with many scripting languages, it doesn't like distinct data types, and so to be as general as possible, all numbers are stored in Lua as double precision floats, which may be a problem depending on what we are trying to do from Lua, if AI and/or command updates are moved to Lua, they will assisted by C++ functions for the 'hard work' tasks.

Cheers.
Glest Advanced Engine - Code Monkey

Timeline | Downloads

Gabbe

  • Guest
Re: Could units have morale
« Reply #7 on: 18 April 2010, 07:53:35 »
If c++ is "stronger" why do you use LUA? sorry, im very confused but i was just wondering.

silnarm

  • Local Moderator
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: Could units have morale
« Reply #8 on: 18 April 2010, 08:07:59 »
If c++ is "stronger" why do you use LUA? sorry, im very confused but i was just wondering.

Because its so much faster to develop in Lua, there is no time expensive compilation/link to go through with every small change. You just change the script, reload the game (and even that can be improved in the future, to load changed scripts while the game is running).

Of course, it is also nowhere near as 'daunting' as C++, so more people might be interested in trying their hand at developing AIs, or to modify the behaviour of commands to meet their mod's needs.
Glest Advanced Engine - Code Monkey

Timeline | Downloads

Gabbe

  • Guest
Re: Could units have morale
« Reply #9 on: 18 April 2010, 08:14:56 »
So if someone took the time to make a c++ AI we would have possible stronger AI so this morale could be possible?

jda

  • Guest
Re: Could units have morale
« Reply #10 on: 18 April 2010, 21:09:21 »
We will see. Lua isn't actually 'interpreted' in the traditional sense, it is compiled as it's loaded, into a bytecode, much like Java or CLR apps. So it performs fairly well... unfortunately, as with many scripting languages, it doesn't like distinct data types, and so to be as general as possible, all numbers are stored in Lua as double precision floats, which may be a problem depending on what we are trying to do from Lua, if AI and/or command updates are moved to Lua, they will assisted by C++ functions for the 'hard work' tasks
First off, thanks for the clarification on Lua "interpretation". :) :thumbup:
Now... "double precision floats"... Erm aren't floating point numbers the ones currently making it impossible to have a stable multiplatform multiplayer game...?  :|
Wouldn't that like somehow break multiplatform multiplayer once it gets fixed?

Of course, it is also nowhere near as 'daunting' as C++, so more people might be interested in trying their hand at developing AIs, or to modify the behaviour of commands to meet their mod's needs.
@ Gabriel
The first time I read silnarm talk about using Lua for AI it was on the "Formations" thread. In the context it came up, Lua would be used to implement AI instructions specific to a given faction or just one unit.
This is way cool, you would not need to change the engine, just pack the Lua scripting with your faction like you can currently do with a scripted scenarios (the scripting those scenarios use, e.g. the "Storming" scenario is Lua). ;)

So if someone took the time to make a c++ AI we would have possible stronger AI so this morale could be possible?
The current AI is C++. :P
The discussion about Lua AI referes to expanding the current AI (which handles several GAE features and even some faction-mods rather poorly). The Lua AI would help fix some of those already existing problems as well as make it easier to expand it further in the future. ;)

@ Anyone on the GAE team:
Please do correct me if I said something wrong. ;D

 

anything