Euflorium: The Eufloria Community

Eufloria => Eufloria Classic => Eufloria Classic Mods => Topic started by: annikk.exe on December 30, 2010, 11:07:59 AM

Title: Any way to return the energy, strength and speed of an asteroid?
Post by: annikk.exe on December 30, 2010, 11:07:59 AM
Without pre-declaring the values, is it possible to detect the energy, strength and speed of an asteroid?

I want to put some stuff in my AI engine to make the AI prefer asteroids with better stats.  I also want to be able to auto-detect what the stats are, without relying on pre-defining them somehow.  This is so that the engine is easily transportable between levels.

Anyone know a way to return the stats ? :>



Something like this is what I'm looking for:
Code: [Select]
roidenergy = GetAsteroid(0).energy
Title: Re: Any way to return the energy, strength and speed of an asteroid?
Post by: Pilchard123 on December 30, 2010, 06:25:40 PM
Sounds about right. I'll poke.
Title: Re: Any way to return the energy, strength and speed of an asteroid?
Post by: Pilchard123 on December 30, 2010, 06:36:19 PM
GetAsteroid(id).CurrentEnergy     will give you the energy of the asteroid. CurrentEnergy  (NOT a function, doesn't need brackets) I think can be used for trees and seedlings, too. Will work on strength and speed.


EDIT: Doesn't look like CurrentStrength and CurrentSpeed exist. Yet.
Title: Re: Any way to return the energy, strength and speed of an asteroid?
Post by: annikk.exe on December 30, 2010, 11:51:10 PM
I think that refers to Core Energy though, doesn't it?  I was talking about the other type of energy :P
Title: Re: Any way to return the energy, strength and speed of an asteroid?
Post by: Pilchard123 on December 31, 2010, 04:58:28 PM
Don't think so, it reterned some ridiculous number like 0.4398758377678595342695657659862340473560374603487348456234765087234034792307463405762407846580760834702875

which looked like the stats energy, not core.
Title: Re: Any way to return the energy, strength and speed of an asteroid?
Post by: Alex on January 01, 2011, 01:21:59 AM
entity.Attribs.Energy
entity.Attribs.Strength
entity.Attribs.Speed
Title: Re: Any way to return the energy, strength and speed of an asteroid?
Post by: Alex on January 01, 2011, 01:23:06 AM
You can actually set the attributes with that... worth experimenting to see what the effects are...
Title: Re: Any way to return the energy, strength and speed of an asteroid?
Post by: annikk.exe on January 01, 2011, 01:32:29 AM
Sweet, thanks! :D
Title: Re: Any way to return the energy, strength and speed of an asteroid?
Post by: pigpenguin on January 01, 2011, 05:04:17 PM
Oh dear alex what have you done? You just gave him the ability to make an even stronger ai then the one he has currently kicking our asses D: oh well the challenge is why you play right? :P
Title: Re: Any way to return the energy, strength and speed of an asteroid?
Post by: Alex on January 02, 2011, 07:53:55 AM
Heh, not only that, but the ability to make the AI... CHEAT!  :o
Title: Re: Any way to return the energy, strength and speed of an asteroid?
Post by: pigpenguin on January 02, 2011, 09:07:31 AM
I think he has always had the ability to make the ai cheat it could kinda control your units at one time :P
Title: Re: Any way to return the energy, strength and speed of an asteroid?
Post by: annikk.exe on January 02, 2011, 03:13:15 PM
Cheat how?  :P  Oh, I suppose the AI could artificially pump the stats on roids that it owns...

But then, I could easily program the AI engine to add seedlings when it's losing.  :>  But that wouldn't really seem fair to the player, and plus, that IS cheating.

I am secretly proud of the fact that the AI does what it does using nothing more than what players get.  Give it some starting seeds and it will play by the rules and still wipe the floor with most players (or so I'm hoping).  No seedlings artificially added, no stats pumped, no illegal seed sending...  the only "actions" that the AI is capable of carrying out is updating its metric, planting trees, and sending seedlings from one asteroid to another.
Title: Re: Any way to return the energy, strength and speed of an asteroid?
Post by: Bonobo on January 02, 2011, 07:16:20 PM
What about the knowledge about asteroids? Doesn’t the AI already know all stats of all asteroids from the beginning while we meek humans still have to explore?
Title: Re: Any way to return the energy, strength and speed of an asteroid?
Post by: Pilchard123 on January 03, 2011, 01:16:08 AM
Yes, but it doesn't use them unless it's explicitly told to. But that's always a good excuse for when the IAI beats you again.
Title: Re: Any way to return the energy, strength and speed of an asteroid?
Post by: Bonobo on January 03, 2011, 02:27:04 AM
[..] But that's always a good excuse for when the IAI beats you again.
Oh well :D I always tell myself that the AI is cleverer than me ;)
Title: Re: Any way to return the energy, strength and speed of an asteroid?
Post by: annikk.exe on January 03, 2011, 02:46:03 AM
Quote
What about the knowledge about asteroids? Doesn’t the AI already know all stats of all asteroids from the beginning while we meek humans still have to explore?

That's an excellent point.
I haven't started implementing this yet, but when I do, I will make sure that the AI can only tell what the stats of an asteroid are if the person implementing the code specifically reveals those asteroids to the AI.  If the AI doesn't know what the stats are, I guess it would judge the quality of unexplored asteroids based on their size - like human players do.

I might also implement some code that allows the AI to scout asteroids, so that it can figure out what their stats are.

The only thing the analysis of asteroid stats/size is going to affect, is which asteroids the AI chooses to colonise first.  An unfortunate side effect of this is that in maps where the stats of asteroids are not procedurally generated, but are specified manually and thus the same every time you play, the AI would always colonise them in the same order.

Currently, the AI treats all asteroids equally when choosing which to colonise first.  The only factor in its decision of the order in which to do it, is which asteroids have the least greys guarding them.  It tries to go for unguarded asteroids first.
Title: Re: Any way to return the energy, strength and speed of an asteroid?
Post by: Pilchard123 on January 03, 2011, 03:22:43 AM
Could you add scouting behaviour to it? Send (or sacrifice) a high energy/speed seedling (better chance of escape) out to an undiscovered roid, discover it, and then run? Or is that there already?

EDIT:

NVM, just read your post again.

Imma herpin da derp derp.
Title: Re: Any way to return the energy, strength and speed of an asteroid?
Post by: annikk.exe on January 03, 2011, 04:58:43 AM
Sending a single scout shouldn't be too hard.

Getting it to return home might be harder though.