Euflorium: The Eufloria Community

Eufloria => Eufloria Classic => Eufloria Classic Mods => Topic started by: annikk.exe on February 02, 2011, 12:44:50 AM

Title: What are you working on? :D
Post by: annikk.exe on February 02, 2011, 12:44:50 AM
What are all you guys working on right now? :>
Lets have a thread for this sort of stuff mayhaps...  rather than everyone posting in their own individual dev blog threads.
Title: Re: What are you working on? :D
Post by: AWS on February 02, 2011, 12:53:35 AM
mayhaps?!! hah - i like it!

im working on... thinking about... possibly... designing a new level.. sometime soon :D
Title: Re: What are you working on? :D
Post by: Pilchard123 on February 02, 2011, 02:17:10 AM
EUCLiD, and a chemistry comp.
Title: Re: What are you working on? :D
Post by: Widget on February 02, 2011, 02:48:07 AM
Trying to bodge together a map consisting of three planetoids, each surrounded by a dozen or so moonlets. The idea is that each moon system should work more-or-less like a small map with one or more close enough to send to the much larger asteroid they surround. Each of the larger asteroids would have a send distance that could reach the outer moons of the other two systems but not the main asteroid itself.

The basic idea is to have at least one empire starting in the moons of each system and (if I can make it work adequately) a steadily increasing number of greys on the central 'roid. All the asteroids' stats would be influenced by scale (including the tree cap) so hopefully I can balance it to have an initial empire-building phase followed by a late-game three-way war. I'm not sure, the main 'roids might need to be dramatically weakened, in relative terms. And it all depends on getting the map laid out adequately in the first place.. the map I plotted on graph paper was too small to take remotely accurate measurements  :-\
Title: Re: What are you working on? :D
Post by: AWS on February 02, 2011, 03:04:02 AM
Trying to bodge together a map consisting of three planetoids, each surrounded by a dozen or so moonlets. The idea is that each moon system should work more-or-less like a small map with one or more close enough to send to the much larger asteroid they surround. Each of the larger asteroids would have a send distance that could reach the outer moons of the other two systems but not the main asteroid itself.

The basic idea is to have at least one empire starting in the moons of each system and (if I can make it work adequately) a steadily increasing number of greys on the central 'roid. All the asteroids' stats would be influenced by scale (including the tree cap) so hopefully I can balance it to have an initial empire-building phase followed by a late-game three-way war. I'm not sure, the main 'roids might need to be dramatically weakened, in relative terms. And it all depends on getting the map laid out adequately in the first place.. the map I plotted on graph paper was too small to take remotely accurate measurements  :-\

dude, this idea is similar to what i wanted to do. i cant wait to see it. as you say, if you can get the balancing right, it should be most excellent. i wish you luck.
looking forward to its eventual release...

Title: Re: What are you working on? :D
Post by: annikk.exe on February 02, 2011, 03:11:38 AM
Wow, this thread took off fast.. :>


Widget, I know a nifty trick for positioning asteroids that you might like:

1.  Load your level.
2.  Turn on developer mode by pressing CTRL-D.
3.  Press F4 and turn off camera limiting, then zoom out so you can see the asteroids.
4.  Press F12 to activate little tooltips next to each asteroid, showing their ID numbers and current X/Y coordinates.
5.  Now open the console, and enter commands such as these:

Code: [Select]
GetAsteroid(37):MoveTo(7530,-1900)to place the asteroid at those coordinates, or...
Code: [Select]
GetAsteroid(37):MoveBy(50,0)to nudge it east a little.

6.  Move all the asteroids around in this way until you are happy with their positions.
7.  Now just write down all the coordinates of the asteroids as you see them on the tooltips.
8.  Edit the level file and enter the coordinates you just wrote down.  :>



I am working on optimizing the 3D Starfield engine.  Right now with more than about 20 asteroids onscreen it runs unacceptably slow, even with fairly sparse stars.  :/
Title: Re: What are you working on? :D
Post by: Widget on February 02, 2011, 03:45:00 AM
dude, this idea is similar to what i wanted to do. i cant wait to see it. as you say, if you can get the balancing right, it should be most excellent. i wish you luck.
looking forward to its eventual release...

The first version is going to be horrendously primitive. The idea is to be using it as the environment to practice annikk's lessons so it'll start as just some asteroids dumped into a map then gradually develop and balance as I get a better understanding. I'll probably try putting IAIv2 in eventually though it'll probably be tricky reigning it in enough to retain the clean separation of early and late game. It would break the balance a little to be invaded by a late-game empire while you're still gathering weak seedlings to control the main asteroid  ;)

Widget, I know a nifty trick for positioning asteroids that you might like:

Thankyou for the point-by-point, that'll be easier to refer back to while I practice. I've been wanting to get back to work on it but by the time I get home in the evenings I'm too tired to think clearly, it's been taking ages to get very little done. Took me nearly an hour just to back-calculate the APR on my ISA today :D Should quiet down after thursday, though, so I'll get properly rested and devote a long weekend to getting the basics done and playing around with seedling numbers.
Title: Re: What are you working on? :D
Post by: Inumedia on February 02, 2011, 03:47:24 AM
Working on implementing multiplayer and waiting for Alex to respond to my PM.  Also debating wether I should have sent a PM to Rudolf, or just used emails all together instead of PM'ing.  o-o;
Title: Re: What are you working on? :D
Post by: Pilchard123 on February 02, 2011, 03:48:08 AM
You could possibly, with a bit of hackishness make it so that the IAI only come into play in the late game, but I don't really know how...

Also, multiplayer is not supported, and very likely won't be.
Title: Re: What are you working on? :D
Post by: annikk.exe on February 02, 2011, 03:50:42 AM
I'd be interested to know how you're trying it, Inumedia.. :>  Welcome, by the way..  ^_^


Alex and Rudolf are super-busy working on getting Eufloria onto the Playstation Network right now, so I wouldn't be surprised if it takes them a while to respond.
Title: Re: What are you working on? :D
Post by: Inumedia on February 02, 2011, 03:53:27 AM
I'm already pretty far

Got networking done, just working on figuring out how their system works.  Already got a server setup and a dedi contracted.  And already got a lot implemented for the most part.  Just running into a few problems; one of them being that the player always has the ID of 1, where as I need that to be changeable.  :3

Right now my current goals are streamlining packets and within the next two days, allowing more than one person in the same game.  It's not an issue of packets, but rather how the client interprets all the data.  I think I'll have that done soon, and then I'll set it up on the dedi and release the modified client.

http://inumedia.net/eufloriadisplay.png

Just a side-note if Alex reads this before my PM or Rudolf just doesn't hear about the PM I sent to Alex, if you don't want me working on implementing Multiplayer, please let me know and I'll discontinue this project of mine o-o;
Title: Re: What are you working on? :D
Post by: annikk.exe on February 02, 2011, 05:52:15 AM
Wow.  That looks pretty impressive dude..

I can't imagine A&R would be anything other than delighted to hear about this.. :>
Title: Re: What are you working on? :D
Post by: annikk.exe on February 02, 2011, 06:05:35 AM
Still trying to optimise the 3D Starfield Init settings for my level..
Title: Re: What are you working on? :D
Post by: Inumedia on February 02, 2011, 07:48:03 AM
Wow.  That looks pretty impressive dude..

I can't imagine A&R would be anything other than delighted to hear about this.. :>

Ah, well that's good to hear.  I've already planned out how the levels and matches will play out and I'm hoping it all ends well when I kick it off for everyone to play on.
Title: Re: What are you working on? :D
Post by: annikk.exe on February 02, 2011, 07:55:31 AM
I'll definitely be up for trying that!  Will you keep us updated on your progress? :>


I am going slowly crazy trying to work out why on earth the stars "jump" when you zoom in/out.  It looks like GetCameraScale() is delayed by 0.3 sec or something...  the stars first move as if they were on a flat plane, and then "jump" to their new positions...


I've tried turning large sections of the code off.  I've tried drastically reducing the number of asteroids and stars.  Basically no matter what I do, the jump is still there to some degree.  The FPS is fine, it's just that jump which is the problem.


But the parallax engine also used GetCameraScale(), and it did not suffer from a star-jumping problem at all.
Title: Re: What are you working on? :D
Post by: Inumedia on February 02, 2011, 07:29:03 PM
Of course, I'll gladly keep you updated.  Right now I'm just trying to get all the seedlings to move around properly and efficiently.  It's a bit of a pain but I also just woke up, so that might have something to do with it. :P
Title: Re: What are you working on? :D
Post by: annikk.exe on February 02, 2011, 09:11:09 PM
How are you doing the communication between clients and server? The screenshot you posted doesnt look like lua.. :>
Title: Re: What are you working on? :D
Post by: Inumedia on February 02, 2011, 09:16:52 PM
How are you doing the communication between clients and server? The screenshot you posted doesnt look like lua.. :>

Nah I use packet structures and then convert them to byte arrays and then send them over an established tcp socket connection to the server.  :3

*points at the Packets folder*

Oh the LuaFilePacket, that was a testing thing I was using a while back.  I had the client connect to the server and the server would send a whole lua file as one big string and then the client would write it to a temp file and then load it :3
Title: Re: What are you working on? :D
Post by: annikk.exe on February 02, 2011, 09:42:47 PM
What language is it.. looks like C..?
Are you actually reverse engineering the game in order to do this ?
Title: Re: What are you working on? :D
Post by: Inumedia on February 02, 2011, 09:47:20 PM
What language is it.. looks like C..?
Are you actually reverse engineering the game in order to do this ?

C#.  It's a bit more complicated then that, but I'm not going to give out any details on that.  For the safety of this game. :P
Title: Re: What are you working on? :D
Post by: Pilchard123 on February 03, 2011, 01:44:07 AM
C# is what Eufloria is built in, so that may be why Inu's using it. However, A&R are rewriting it in C++. Sorry to be the bearer of bad news if that's a problem.

http://www.dyson-game.com/smf/index.php?topic=1217.msg7607#msg7607

If you want testers, I'd love to help sometime. I know no C or any of its variants, but I'm fairly good with EufLuaria (u c wut i did thar?) and playing the game.
Title: Re: What are you working on? :D
Post by: Inumedia on February 03, 2011, 04:32:00 AM
C# is what Eufloria is built in, so that may be why Inu's using it. However, A&R are rewriting it in C++. Sorry to be the bearer of bad news if that's a problem.

http://www.dyson-game.com/smf/index.php?topic=1217.msg7607#msg7607

If you want testers, I'd love to help sometime. I know no C or any of its variants, but I'm fairly good with EufLuaria (u c wut i did thar?) and playing the game.

Ah, well, it's good to hear that they're not using C# anymore.  Either-way I'll be continuing my work, I just don't plan on staying up to date with the features they add.
Title: Re: What are you working on? :D
Post by: Aino on February 03, 2011, 09:59:53 PM
A virus infection map, play as a virus infecting a human body... and will also include a hard AI :P
Title: Re: What are you working on? :D
Post by: annikk.exe on February 03, 2011, 10:27:04 PM
Sounds cool.  :>  Are you making your own AI?  I'm kind of hoping eventually we can have lots of different AI's.  We could make them fight each other, and have competitions to see who can make the best one.  :>

It would only take a small amount of work for me to modify the engine to turn off Infected AI on asteroids that don't belong to a particular faction.  I keep meaning to try IAI versus the default AI, but the thing is the default AI has tons of different settings, so the performance could well vary...
Title: Re: What are you working on? :D
Post by: Aino on February 03, 2011, 10:37:07 PM
Sounds cool.  :>  Are you making your own AI?  I'm kind of hoping eventually we can have lots of different AI's.  We could make them fight each other, and have competitions to see who can make the best one.  :>

It would only take a small amount of work for me to modify the engine to turn off Infected AI on asteroids that don't belong to a particular faction.  I keep meaning to try IAI versus the default AI, but the thing is the default AI has tons of different settings, so the performance could well vary...
I could, if I only know how to make the AI select the correct roid, have been experimenting allready with no success... Hoping I eventually will make one though :D
Title: Re: What are you working on? :D
Post by: annikk.exe on February 03, 2011, 10:59:37 PM
IAI is based on the idea of swarm intelligence.  If you want to know more about how it works, there's a dev blog here (http://www.dyson-game.com/smf/index.php?topic=1171.0) that I wrote whilst overhauling it.  To me, it seems the most practical way of doing it.  However there are bound to be other ways that I have not thought of.. :>
Title: Re: What are you working on? :D
Post by: Aino on February 03, 2011, 11:03:53 PM
Mhm, swarming is the smartest way... I can't really think of anything else when you first mention it xD
Title: Re: What are you working on? :D
Post by: annikk.exe on February 03, 2011, 11:06:46 PM
Swarm Intelligence means it is composed of individuals that do not have any view of the big picture, but rather just base their actions on their own immediate surroundings.

This means that a series of simple rules (eg, if my friendly neighbour is under attack, send seedlings to help) can result in extraordinarily complex behaviours.


However I guess you could also do it from the perspective of the empire as a whole.  It might consider its whole empire vs the whole enemy empire, and derive some strategic insight from that.  These are capabilities that IAI lacks.
Title: Re: What are you working on? :D
Post by: Aino on February 06, 2011, 10:09:07 AM
Ok, I began with an AI cause you just made me want to do it after you wrote about it, thanks annikk :P

It will be compitable with every map, like IAI, but I don't know what should be so special about it, need ideas so let them come please :D
Title: Re: What are you working on? :D
Post by: annikk.exe on February 06, 2011, 10:23:29 AM
To begin with I'd just focus on getting your AI to colonise asteroids efficiently, defend itself if attacked, and launch attacks on enemy asteroids.  Once you've got those basics down really well, you could look at things like flower handling, mine usage, and prioritising valueable asteroids for expansion.  :>
Title: Re: What are you working on? :D
Post by: Aino on February 06, 2011, 10:28:56 AM
Quick note though, I'm allready done with the priority system, and the seedlings know where to go :D

But, testing
entity.Attribs.Energy
entity.Attribs.Strength
entity.Attribs.Speed
and they don't seem to work very well when using them:
Code: [Select]
if GetAsteroid(asteroids).Attribs.Strenght > GetAsteroid(asteroids).Attribs.Energy and GetAsteroid(asteroids).Attribs.Strenght > GetAsteroid(asteroids).Attribs.Energy then
PlantDefenseTree(caiid)
else
PlantDysonTree(caiid)
end
gives error:
Quote
attempt to compare number with string
so... lol? What does this mean D:

EDIT: annikk, consider making IAI compitable by using only a limited amount of factions so our AI's can work in harmony? :P
Title: Re: What are you working on? :D
Post by: annikk.exe on February 06, 2011, 10:40:06 AM
Yeah I can pretty easily set my AI so it will only control seedlings/asteroids/flowers belonging to the empires I choose for it to control.

So we can make yours empire 2, and mine empire 3, or something.. :>



By the way, are you remembering to set a global Grace Timer?  I set mine to 99999.  That way the default AI will never try to take control of anything.  :>
Title: Re: What are you working on? :D
Post by: annikk.exe on February 06, 2011, 10:40:59 AM
Also it's because you mis-spelled "strength".  :>


Also:

Code: [Select]
PlantDefenseTree(caiid)
You need to tell it which asteroid to plant on.
EG:

Code: [Select]
GetAsteroid(0):PlantDefenseTree(2)
Title: Re: What are you working on? :D
Post by: annikk.exe on February 06, 2011, 10:43:23 AM
I am tinkering folornly with my 3D engine, trying to figure out some way to make it a million times more efficient..
Title: Re: What are you working on? :D
Post by: Aino on February 06, 2011, 10:58:32 AM
I see :)

But got that damn error again:
Quote
attempt to compare number with nil

WTF?! (sry for swears, I am so pissed of by that and the computer is a retard, cause the number is just printed in its face, but it ain't realising -.-(I think?))

EDIT: I ask for help, and I am so stupid and aren't allowing you cool guys to look at the code xD
Title: Re: What are you working on? :D
Post by: Aino on February 06, 2011, 11:28:02 AM
Please help! D:
Title: Re: What are you working on? :D
Post by: annikk.exe on February 06, 2011, 11:57:13 AM
Lets see...  it's complaining about line 188.


Code: [Select]
if cairoidpriority[asteroids] < cairoidpriority[i] then
Most likely cause is that you haven't initialised the values in those arrays to anything.
The error is "attempt to compare nil with number".
That means the value for one of the slots of cairoidpriority must be nil.  "nil" means no value, it is different to zero.  You can't do arithmetic comparisons against "nil", otherwise Eufloria will produce this error.


To fix, consider making a for loop in your LevelSetup to assign values to all the slots in that array.
Title: Re: What are you working on? :D
Post by: Aino on February 06, 2011, 08:29:25 PM
Thanks annikk, the AI is functional now, but doesn't care about anything else than trees or flowers, but that is the most important things, right?

EDIT: It cares about roids, trees and SEEDLINGS!:P
Title: Re: What are you working on? :D
Post by: Aino on February 06, 2011, 09:44:25 PM
The AI pwns the normal one :) Even though it is all fair, it react somewhat faster than the normal one(but still slower, lol xD)... I have bigger plans for the AI, you'll need to wait and see :D
Title: Re: What are you working on? :D
Post by: Pilchard123 on February 07, 2011, 01:33:12 AM
Hoo boy...

I've just realised that I may need to change the leval- and empire-saving sections of EUCLiD - potentially requiring that I rewrite the whole thing. Yay.
Title: Re: What are you working on? :D
Post by: Aino on February 07, 2011, 02:08:23 AM
I will give the AI an unique ability: Learn from mistakes, like sending to much leaving no defense and loose the roid after will cause it to send less to leave more defense :)
Title: Re: What are you working on? :D
Post by: Pilchard123 on February 07, 2011, 02:39:46 AM
Has that been done with anything yet? I mean, even research-grade robotics? More power to you if you can get it to work, but...
Title: Re: What are you working on? :D
Post by: Aino on February 07, 2011, 02:44:54 AM
Well, I might have the idea of how to do it :P But it will not learn about everything...
Title: Re: What are you working on? :D
Post by: annikk.exe on February 07, 2011, 07:36:34 PM
Barely did any coding this weekend.  Instead, I've been working on my new song (http://www.dyson-game.com/smf/index.php?topic=1246.msg8009#msg8009).  :>

Going to do a final version tonight with production tweaks.  Feedback would be useful and very much appreciated! :>
Title: Re: What are you working on? :D
Post by: annikk.exe on February 09, 2011, 07:10:56 AM
Well I finished the song tonight (hopefully finished, anyway) so I guess it will be back to coding tomorrow.  I guess I will release a new map with the 2 new engines I've built (3D Starfield, and the mystery engine) soon.
Title: Re: What are you working on? :D
Post by: Aino on February 09, 2011, 02:36:09 PM
O.o, mystery engine?
Title: Re: What are you working on? :D
Post by: annikk.exe on February 09, 2011, 04:26:47 PM
It's the thing that powers the mystery machine!


Heh.  It's actually just a new mechanic I've designed, which does something.  I'm not revealing what yet.  :>
Title: Re: What are you working on? :D
Post by: Sniped50 on February 10, 2011, 12:06:39 AM
God, that reminds me of those 'mystery pies' I once saw in a movie when I was, like, 5.

This new engine won't have mud or worms hidden inside, will it? :P
Title: Re: What are you working on? :D
Post by: Bonobo on February 10, 2011, 04:10:43 AM
Venus Seedlingtraps, probably.
Title: Re: What are you working on? :D
Post by: Aino on February 12, 2011, 11:13:13 PM
Ok, thanks to the beta testing of your new mechanic, I am gonna make something I wanna call a "Command Central" thingy for the player, describing more as I come into it :D(The AI is so tiring to make at atm, so I am taking a pause on it :P)
Title: Re: What are you working on? :D
Post by: Bonobo on February 13, 2011, 06:18:54 AM
Just so that you have a laugh towards the end of the day: http://xkcd.com/859/ :D
Title: Re: What are you working on? :D
Post by: annikk.exe on February 13, 2011, 10:07:49 AM
New level will be chock full of surprises.. :>
But none of those surprises will be mud or worms.  Ew.  :P
No Venus Seedlingtraps either...  You might experience some dizziness though, and start seeing stars....  hehe..
Title: Re: What are you working on? :D
Post by: Bonobo on February 14, 2011, 05:50:36 AM
For all you hard core coders: A wife asks her husband, a software engineer... (http://www.reddit.com/r/funny/comments/fklb1/a_wife_asks_her_husband_a_software_engineer/) (For thorough fun be sure to go through the comments, too.)
Title: Re: What are you working on? :D
Post by: annikk.exe on February 14, 2011, 08:36:07 AM
I am working on chilling out, at the end of another large coding project.  :>


Also I am working on my post count, heh.  I'll be at 1000 posts soon.  Maybe I get a free hat or something.  :P
Title: Re: What are you working on? :D
Post by: Widget on February 14, 2011, 07:27:27 PM
I am working on chilling out, at the end of another large coding project.  :>

I was starting to think you never slept!  ;)

(For thorough fun be sure to go through the comments, too.)

How do I unread it?! :'(
Title: Re: What are you working on? :D
Post by: Aino on February 15, 2011, 09:36:45 PM
Gotten wuite far with CC, rallying is soon possible :D
Title: Re: What are you working on? :D
Post by: annikk.exe on February 15, 2011, 09:55:51 PM
Oh.  Are you sure this isn't the same functionality as Pilchard's Rally Points?
http://www.dyson-game.com/smf/index.php?topic=880.0
Title: Re: What are you working on? :D
Post by: Aino on February 15, 2011, 09:56:35 PM
I dunno yet, gotta check it then before I do some more progress with it :)
Title: Re: What are you working on? :D
Post by: Aino on February 15, 2011, 10:04:25 PM
Fine, I'll quit the project :) It seems to be better than mine anyways. Well one thing is annoying me with it, for me it is juist in the middle of the screen(the bar) and not in a corner, I don't think that is how it is meant to be?
Title: Re: What are you working on? :D
Post by: annikk.exe on February 15, 2011, 10:06:35 PM
You could always continue your own one, and make a version you like better.. :>
Title: Re: What are you working on? :D
Post by: Aino on February 15, 2011, 10:07:51 PM
Mehh :P But I got one thing out of it... A technique to make my AI almost lagless I think, unless it really was a bug :/
Title: Re: What are you working on? :D
Post by: annikk.exe on February 15, 2011, 10:12:10 PM
I have started teaching myself C++.

Check out my super-cool program:

(http://img718.imageshack.us/img718/7821/chickens.png)


It requests the user to enter a number of chickens.  It waits for the user to type a number and press enter, then it tells them the number they just typed in!
Amazing, huh?  :>
Title: Re: What are you working on? :D
Post by: Aino on February 15, 2011, 10:14:27 PM
Learnt some java and C++ (Still noob though, I can't write it without any tutorials x.x)  :) Hopy you know that you can use x++ instead og x=x+1 (where x is jsut a number variable :P) :)

But nice that you've started C++ :P
Title: Re: What are you working on? :D
Post by: annikk.exe on February 15, 2011, 10:24:16 PM
Nice - thanks for the tip! :>
I've just been going through some tutorials.  Spent less than 2 hours on it so far, so it's early days yet!
Title: Re: What are you working on? :D
Post by: Aino on February 15, 2011, 10:24:42 PM
And what kind of compiler do you use? I use this one: http://sourceforge.net/projects/dev-cpp/files/Binaries/Dev-C%2B%2B%204.9.9.2/devcpp-4.9.9.2_setup.exe/download (http://sourceforge.net/projects/dev-cpp/files/Binaries/Dev-C%2B%2B%204.9.9.2/devcpp-4.9.9.2_setup.exe/download) (Takes you directly to download!)
Title: Re: What are you working on? :D
Post by: annikk.exe on February 15, 2011, 10:25:28 PM
I'm just using the one that comes with Visual Studio.
Title: Re: What are you working on? :D
Post by: Aino on February 15, 2011, 10:28:04 PM
Never heard of it, jsut sticked with bloodshed after I saw it from a tutorial :)
Title: Re: What are you working on? :D
Post by: Aino on February 15, 2011, 10:32:11 PM
You could always continue your own one, and make a version you like better.. :>

Lol, I think this was you 1000th post, or?
Title: Re: What are you working on? :D
Post by: annikk.exe on February 15, 2011, 11:24:45 PM
Heh, don't know... I didn't even notice my 1000th.  :>
Title: Re: What are you working on? :D
Post by: Aino on February 16, 2011, 05:02:49 AM
Released my map which I made today, how is it possible to make a map in one day?
Title: Re: What are you working on? :D
Post by: Aino on February 17, 2011, 02:54:51 AM
Ok, today I have been taking my project CC serious and wrote the plans down, ALL OF IT. Atleast all I can think of. Right now I am exhausted cause of that xD
Title: Re: What are you working on? :D
Post by: annikk.exe on February 17, 2011, 03:25:07 AM
Nice.  :>
I find writing down exactly what an engine or a piece of code is supposed to do, helps me to spot flaws in the logic I had envisaged, or gaps in how something is supposed to work.  Did you find it useful too? :>  I guess you will have your writings to refer to now, when you come to coding it.. :>
Title: Re: What are you working on? :D
Post by: Aino on February 17, 2011, 03:29:38 AM
I think it is kinda nice :) It tells all the goals with doing the code is, then the functions itself, but only what is supposed to be in it and after that all the varibales and what tehy are(arrays, integers, reals...) :D

After that I will make comments on what I am doing according to all the information in the "recipe" for the code :)
Title: Re: What are you working on? :D
Post by: Aino on February 17, 2011, 08:51:15 PM
I see now, that writing yesterday was helpful as hell, tried to code CC again(from the beginning) and it works totally properly :D
Thank so very much annikk :D:D:D
Title: Re: What are you working on? :D
Post by: annikk.exe on February 17, 2011, 11:48:45 PM
w00t - glad to hear it!  :>

You are most welcome... :>
Title: Re: What are you working on? :D
Post by: Aino on February 18, 2011, 02:05:47 AM
I need beta testers soon though :)
Title: Re: What are you working on? :D
Post by: annikk.exe on February 18, 2011, 02:14:29 AM
Sweet.. :>


Best to make a new thread when you ask for Beta Testers, so that it's really obvious when they visit the forum.

Also remember you'll need to allow a couple of days for everyone to get back to you.  Most beta testers sign up, receive their copy of the map, then say something like "oh, I'll have time to play this tomorrow probably."  Frustrating. :P  Especially when you have a new map almost ready to go, it's very frustrating that they don't share your sense of urgency.  But the feedback is crucial, so I have learned to be patient.. :>


Anyway, some beta testers are really awesome, and will get back to you with large amounts of detailed feedback within hours... :>
Title: Re: What are you working on? :D
Post by: Aino on February 18, 2011, 02:30:31 AM
Like me? *JK*

But I am not quite ready for it yet, need to make a map first(beta-testers is obviously not interesting in making their own map and then putting in all the crap :P)
Title: Re: What are you working on? :D
Post by: Aino on February 18, 2011, 03:07:45 AM
Letter A is ready :)

Title: Re: What are you working on? :D
Post by: Bonobo on February 18, 2011, 03:33:30 AM
OMG that’ll be a HUGE amount of work. Better to check in to some #typography (http://en.wikipedia.org/wiki/Typography) lessons first, I guess ;D Stick with sans-serif for the beginning (as you did) ;)

Be sure you know what you want, though. Steve Jobs (co-)founded Apple, Inc., after visiting typography and calligraphy lessons :D
Title: Re: What are you working on? :D
Post by: Aino on February 18, 2011, 03:38:20 AM
Nah, not huge amount of work... I am not sticking with any font type either, only the letters are readable is fine for me :)

I am already with C :D
Title: Re: What are you working on? :D
Post by: annikk.exe on February 18, 2011, 04:14:43 AM
C is going to be tricky.  How will you get the curve, I wonder?  :>  Or will you just not curve it?
Title: Re: What are you working on? :D
Post by: Aino on February 18, 2011, 04:34:32 AM
I didn't curve it :) Keeping it simple so I can finish it tommorow. I'll post a picture :D
Title: Re: What are you working on? :D
Post by: AWS on February 18, 2011, 07:35:20 AM
nice job on the lettering. its kinda retro ;D

sign me up for some beta-ing. im down for that stuff and i provide heartfelt and loving feedback...
you know its true  ::)

aws

i suppose i should get my map started then seeing as y'all seem to be making one a week right now...
Title: Re: What are you working on? :D
Post by: Aino on February 19, 2011, 12:55:59 AM
Done with the text stuff(which I think is quite a big thing :)) and going back to CC with text, results you say? Watch!
Title: Re: What are you working on? :D
Post by: Bonobo on February 19, 2011, 02:14:18 AM
@Aino: Very, very, very cool!
Title: Re: What are you working on? :D
Post by: Aino on February 19, 2011, 03:02:29 AM
Thanks, hope to be done with it today and tommorow it is my AI I'll be workin' on... After all that I'll take a break and calm down for some days, maybe...
Title: Re: What are you working on? :D
Post by: annikk.exe on February 19, 2011, 08:49:52 AM
Quote
After all that I'll take a break and calm down for some days, maybe...

I know the feeling!
Once one gets this coding thing down, it just bites and doesn't let go.  It's soooo fun and satisfying and addictive.  :>
Title: Re: What are you working on? :D
Post by: Aino on February 19, 2011, 09:17:41 AM
Ye, I should never been doing this, or?
Title: Re: What are you working on? :D
Post by: Aino on February 22, 2011, 07:51:03 PM
Commando Center is soon done... Hoping to release a map with it, thinking of Capture the Asteroid because I think it fits with some huge empire controller(CC) :)

I'm soon hoping I'm gonna finnish my AI too :P
Title: Re: What are you working on? :D
Post by: annikk.exe on February 24, 2011, 06:01:03 AM
Feeling really depressed about Libya.
Title: Re: What are you working on? :D
Post by: Widget on February 24, 2011, 06:42:58 AM
Definitely. And feeling a nebulous sense of guilt-by-association that my country's politicians have been so closely involved with such an awful dictator.
Title: Re: What are you working on? :D
Post by: Bonobo on February 24, 2011, 07:57:15 AM
Same here. Since the early days of the Tunisian revolt I’ve become more active on Twitter & Facebook and watching Al Jazeera English etc., sharing info w/ ppl who before didn’t have them, but now this in Libya is heartbreaking; depression I already had before and it surely doesn’t get better from this. And @Widget: Sure it’s not just your country that has been profiting from Gaddafi and other dictatorships down there, I think every western “democracy”, but also e.g. Russia and China have their fingers in this. Egypt, for example, is/was Germany’s most important customer of military stuff, those tanks you saw on Al Tahrir square were “nice” German Leopard 2 tanks, tear gas grenades from the US, Libyan warplanes, I think, are Russian MIGs etc. etc.

The consequences … will be harsh, also for many of us. We’ll have to prepare not only for the fact that our next winter will be a lot more expensive, but also our “normal” gasoline for cars etc., and we’ll also have to prepare for allowing more people inside who seek asylum. But, you know, f*ck it, even if I don’t know how I’ll get through next winter, this is all nothing against what people there have to endure now. And I seed on oil costs if only our (EU) governments would not only threaten with embargos etc. but if they did it NOW and not wait.

I want to see Gaddafi before the International Court in The Hague (Den Haag). But right now I’d rather see a cruise missile in Gaddafi’s Head Quarters.

Oy vey.
Title: Re: What are you working on? :D
Post by: annikk.exe on February 24, 2011, 10:05:49 PM
Leaving for Abu Dhabi early tomorrow morning.  Business trip.
Hopefully they don't decide to have a revolution too...
Title: Re: What are you working on? :D
Post by: Widget on February 24, 2011, 10:23:06 PM
We'll be thinking of you. Hope your trip turns out quiet, boring and safe.
Title: Re: What are you working on? :D
Post by: Pilchard123 on February 24, 2011, 11:02:25 PM
Yeah, don't try to topple any governments.




http://www.gizmag.com/gold-to-go-gold-vending-machine/15093/

Hope they pay you a decent amount. ;D
Title: Re: What are you working on? :D
Post by: annikk.exe on February 27, 2011, 06:58:08 PM
Anyone know anything about Cisco?
Title: Re: What are you working on? :D
Post by: Pilchard123 on February 27, 2011, 08:25:39 PM
It's networking stuff isn't it? That's about all I know, but...
Title: Re: What are you working on? :D
Post by: annikk.exe on February 28, 2011, 06:27:02 PM
Yup!

Specifically, I need to know how to:

1) Establish a PPPoE connection with NAT, to a fibre modem connected via FA1
2) Run a DMVPN spoke (already configured) over said connection.


This is on a Cisco 877.
Title: Re: What are you working on? :D
Post by: Aino on February 28, 2011, 11:00:16 PM
Dunno, sry :/

Still haven't finished CC, need to wait till A&R fixes SendTo command I guess...

EDIT: Unless I do it wrong...
Title: Re: What are you working on? :D
Post by: Pilchard123 on March 01, 2011, 03:33:43 AM
If all else fails...teh intertubez iz ur frend.


EDIT:
http://www.networking-forum.com/viewtopic.php?p=146815   looks to be your specific problem number 1), or very close. EDIT AGAIN: That's cuz you asked it there last year... I feel dumb.

http://www.cisco.com/en/US/docs/ios/sec_secure_connectivity/configuration/guide/dmvpn_dt_spokes_b_nat.html   is the Cisco page for your problem number 2)
Title: Re: What are you working on? :D
Post by: annikk.exe on March 01, 2011, 08:03:21 PM
Actually that first link you posted is a thread I made on that forum just a few days ago, asking for help.  :>

I'm back home now, and exhausted.  Going to sleep for a bit I guess..
Title: Re: What are you working on? :D
Post by: Aino on March 01, 2011, 09:22:03 PM
How is C++ doin' Annikk, any progress?
Title: Re: What are you working on? :D
Post by: Aino on March 02, 2011, 05:36:52 AM
Workin' on a CTF like map... But the auto owner thing annoys the crap of me -.- ALL THE TIME! How do I remove it?
Title: Re: What are you working on? :D
Post by: Rudolf on March 02, 2011, 07:27:21 AM
Jeepers, sounds like there is amazing stuff going on here on the forums!

We are indeed utterly utterly swamped, but I will try to process this somehow asap, and chat to Alex about it.
Pm's sometimes get answered s bit late due to our deadlines. We are doing a release on a major console with very few people which is bloody hard.

We could use testers soon actually!
Title: Re: What are you working on? :D
Post by: Pilchard123 on March 03, 2011, 01:14:44 AM
I'll test!

..if you give me an iPad/iPhone/PS3/X360/whatever you happen to be testing it on.


PC gaming ftw!
Title: Re: What are you working on? :D
Post by: Aino on March 03, 2011, 01:19:55 AM
I think it is PS3, I dunno... But if it is, sign me up for beta testing, but I might not have availability to play sometimes though :/
Title: Re: What are you working on? :D
Post by: Inumedia on March 03, 2011, 01:15:18 PM
I'm still wondering why you guys didn't just port it to XNA and put it on the 360 o_o;
Title: Re: What are you working on? :D
Post by: Rudolf on March 03, 2011, 04:27:02 PM
Thanks for the offers guys, more detail soon. :-)

We did not go the 360 route because Microsoft has become EXTREMELY unfriendly to indies in various ways, and on top of that they demand all kinds of features to be bolted on to games even if it makes no sense for the game in question. As a result developing an xbla version is too expensive and too risky.

Title: Re: What are you working on? :D
Post by: annikk.exe on March 03, 2011, 08:06:14 PM
Quote
Microsoft has become EXTREMELY unfriendly to indies in various ways, and on top of that they demand all kinds of features to be bolted on to games even if it makes no sense for the game in question.

In that case I welcome your decision.  :>


Speaking of updates, there is an update request mentioned here (http://www.dyson-game.com/smf/index.php?topic=778.msg8138#msg8138) which I would love if you could look at, when you get time.  I realise your current project is far more important for the success of Eufloria generally though, so I'm happy to wait.  :>


Thanks for checking in by the way!  It's great to hear from you, and I'm really looking forward to the time when you are a bit less busy and can post regularly again.  :>
Title: Re: What are you working on? :D
Post by: Aino on March 05, 2011, 12:49:18 AM
Now I'm workin' on a fancy background, won't work until draw behind or layers have been added... I'll publish the code after draw behind or layers is added! But maybe you want to have a look at it?
Title: Re: What are you working on? :D
Post by: Aino on March 05, 2011, 06:27:19 AM
I'm done with the basics of Fancy Background, got a 5 hours brake though, slow progress that way -.-
Title: Re: What are you working on? :D
Post by: Inumedia on March 05, 2011, 10:54:49 AM
Thanks for the offers guys, more detail soon. :-)

We did not go the 360 route because Microsoft has become EXTREMELY unfriendly to indies in various ways, and on top of that they demand all kinds of features to be bolted on to games even if it makes no sense for the game in question. As a result developing an xbla version is too expensive and too risky.



Ah.  That explains that. :P
Title: Re: What are you working on? :D
Post by: Aino on March 06, 2011, 08:48:58 PM
Gonna learn some C#, see if I get some results(Wanna make a 3D game :)).
Title: Re: What are you working on? :D
Post by: Pilchard123 on March 07, 2011, 01:57:57 AM
Try Unity. You can use a variant of Javascript, which is so much easier to learn. It's free, unless you want the Pro features, or have more than $100k turnover a year. It's also really easy to learn, at least I found it so. unity3dstudent.com is a good (and free!) tutorial site. The tornadotwins have some good stuff on youtube too.

www.unity3d.com


EDIT: Oh, and you can develop for amost any major platform. Some (ie anything that isn't Windows, Mac, Linux or the 'net) licences you have to pay for, but...

In short, it's good, I like it.
Title: Re: What are you working on? :D
Post by: Aino on March 09, 2011, 03:18:07 AM
Java? Srsly, java is plain annoying with all the uppercased letters, just hoping it isn't like that in unity, gonna give it a try :)
The uppercased letters is why I quited java scripting, but Java is where I learned all about coding, so if I release any cool maps or functions, thank Java(and WC3... for making me want to code in the first place). A good tutorial for java(on youtube, WITH COMMENTARY... THAT ISN'T ANNOYING!) is Here :D (http://www.youtube.com/watch?v=Hl-zzrqQoSE)(Watch all of the 100 episodes(literally!!!))... Maybe I ran a little off topic...
Title: Re: What are you working on? :D
Post by: Aino on March 09, 2011, 03:35:02 AM
Hey, unity uses C#! o.O
Title: Re: What are you working on? :D
Post by: Pilchard123 on March 10, 2011, 02:07:37 AM
Javascript is NOT Java, or even anything to do with Sun Microsystems.

However it doesn't make much difference which language you use, so...
Title: Re: What are you working on? :D
Post by: Aino on March 10, 2011, 09:43:51 PM
Heard of javascript, but haven't learn't about it...
Title: Re: What are you working on? :D
Post by: Pilchard123 on March 11, 2011, 02:00:52 AM
Javascript is a scripting janguage used in webpage design, and also mashed into in Unity.
Title: Re: What are you working on? :D
Post by: annikk.exe on March 11, 2011, 08:22:09 PM
Important meeting today. :O
Title: Re: What are you working on? :D
Post by: Aino on March 11, 2011, 09:35:31 PM
o.O
Title: Re: What are you working on? :D
Post by: annikk.exe on March 12, 2011, 04:46:06 AM
No worries.  :>
Title: Re: What are you working on? :D
Post by: Aino on March 12, 2011, 05:34:02 AM
Okay :)
Title: Re: What are you working on? :D
Post by: Avaguard on March 20, 2011, 11:03:13 AM
every 1 sounds amazing  8) .....well im workin on a kind of maze map maybe.... :-X
Title: Re: What are you working on? :D
Post by: Aino on March 20, 2011, 11:51:23 PM
Nice, but how are you gonna do it?
Title: Re: What are you working on? :D
Post by: annikk.exe on March 23, 2011, 08:39:16 PM
I have entered another period of total inactivity in map design.
I have no ideas I feel like pursuing right now.  There are things I could work on, but the urgency seems less than some of my other, non-Eufloria-related projects.

I'm also pretty depressed about the whole LineDraw thing.  Still hoping that will be addressed one day, when A&R are around again..
Title: Re: What are you working on? :D
Post by: Aino on March 23, 2011, 09:28:51 PM
Alex is around once a day it seems :) Ansd I got starcraft 2, maybe we can play? :D
Title: Re: What are you working on? :D
Post by: Avaguard on March 25, 2011, 01:16:03 AM
dat sounds kool lol hmm is it at all posible to change how the trees look or mean grow in to like maybe a swirle tree i highly doubt it
Title: Re: What are you working on? :D
Post by: Aino on March 25, 2011, 02:10:52 AM
Request it :) Higher chance to do it then :D
Title: Re: What are you working on? :D
Post by: Aino on April 17, 2011, 02:30:26 AM
Making a GetMouseX() and GetMouseY() function :D
Title: Re: What are you working on? :D
Post by: Pilchard123 on April 17, 2011, 02:46:56 AM
There's already one, I think.

Yeah, but I don't think it's documented.

GetMouseScreenX()
GetMouseScreenY()

If you want a world co-ordinate one, then you might have to make it yourself, but...
Title: Re: What are you working on? :D
Post by: Aino on April 17, 2011, 02:55:29 AM
And I am done :D

By the way, I'll give something I worked on ever the night... It's a gravity/bouncing thing... And no, it's not gravity like Annikk's gravity engine...
Title: Re: What are you working on? :D
Post by: Aino on April 17, 2011, 02:56:34 AM
Ye, I saw you use it Pilchard, so I guessed that if I mess around with GetCameraX() and GetMouseScreenX() and some other stuff, I'll brew that function :)

EDIT: It's my B-Day today too  8) (Turning 15!)
Title: Re: What are you working on? :D
Post by: Bonobo on April 17, 2011, 03:44:04 AM
Hey :-) Happy B-Day to you! Stay healthy and happy!
Title: Re: What are you working on? :D
Post by: annikk.exe on April 17, 2011, 04:16:55 AM
Happy Birthday Aino. :>
Title: Re: What are you working on? :D
Post by: Aino on April 17, 2011, 05:13:25 AM
Thanks :D
Title: Re: What are you working on? :D
Post by: Aino on April 29, 2011, 09:40:38 PM
Thinking of making a new and better version of Alien AI, where the AI will calculate what they will get from invading an asteroid:

Quote from: Scenario
If the AI have lost all of their asteroids and have one left(which has the attribs of: 0.5 energy, 0.6 speed and 0.5 strength and with 25 seedlings), then it will look at the neighbours:

The firsth neighbours has as following:
  • Energy=0.7
  • Speed=0.4
  • Strength=0.5
now the AI look at the asteroid with most of all the stats, which is their only asteroid and calculate how many points the attribs will give. Now, since the neighbour have 20 enemy seedlings the AI must find the amount of difference the two asteroids have. it will get an ending score at: 1.25

The second neighbour has:
  • Energy=0.6
  • Speed=0.3
  • Strength=0.7
  • Seedlings=17
  • Score: 1.47

The roid with highest score is reccomended to capture and the AI will do so...(hope you understood, if not... read is closely! :))

Let's begin coding :D
Title: Re: What are you working on? :D
Post by: annikk.exe on May 02, 2011, 09:33:44 PM
Sounds like you've got the planning thing down pretty good.. :>

AI battles ftw!  If you make an AI that can defeat Infected, the ball will once again be in my court...
Title: Re: What are you working on? :D
Post by: Aino on May 02, 2011, 09:35:50 PM
Tried once, it crashes, so I'll do it next weekend or sometime, but the details is there :)

Edit - I also have plans making all asteroids having "chosen" neighbours, if the distance away from the asteroids are changed, then it will recheck and get new neighbours :)

Edit 2 - Appearantly I started today o.O But I need help with a little thing, anyone can figure out a calculation for the computer, calculating how much loss the AI will get by attacking an asteroid with defence tree(s)... I want it to say that when you have 500 seeds attacking it is 0 and 5 is 5, and no, I don't want to use if statements...

One I've found, but it won't work on highh amount of seedlings:
Code: [Select]
SeedAmount - ((Seedamount/10)/Deftreesamount)Maybe you can work out on that one??
Title: Re: What are you working on? :D
Post by: Aino on May 03, 2011, 03:13:24 AM
Ok, have made a scratch of the map I'll introduce it in too, sadly it's made on paper... but I made it by making doodles(Hope that was correct :P) and just making circles where some lines crossed... You'll see how it turned out :)

[thinking]Maybe I should make a topic about all my inventions too? Like Annikk...[/thinking]
Title: Re: What are you working on? :D
Post by: Pilchard123 on May 03, 2011, 04:17:30 PM
I still think A&R should install ultimate profile.
Title: Re: What are you working on? :D
Post by: Aino on May 03, 2011, 07:07:04 PM
For what?
Title: Re: What are you working on? :D
Post by: Pilchard123 on May 04, 2011, 01:30:24 AM
Invention-hoarding.
Title: Re: What are you working on? :D
Post by: Aino on May 04, 2011, 02:05:45 AM
Lol :)
Title: Re: What are you working on? :D
Post by: Aino on May 04, 2011, 03:37:35 AM
Sry people, seems there won't be any Alien AI 2.0, it seems to just create more rubble than I can remove... But I will update the old AI and making it slightly harder...
Title: Re: What are you working on? :D
Post by: Aino on May 04, 2011, 04:27:43 AM
Ok, edited my AI and added two things, both of them improves the AI significantly... I won't spoil though, but the behaviour of the AI says enough :)
Title: Re: What are you working on? :D
Post by: annikk.exe on May 23, 2011, 11:38:59 PM
I started coding again today.
Title: Re: What are you working on? :D
Post by: Aino on May 23, 2011, 11:45:45 PM
Finally :D
Title: Re: What are you working on? :D
Post by: Pilchard123 on May 24, 2011, 02:21:05 AM
I'm not sure whether the music we should have here is the 2001 theme or Morning from Peer Gynt.


Nah, Fanfare for the Common Man. The original orchestral version.
Title: Re: What are you working on? :D
Post by: Aino on May 24, 2011, 03:05:42 AM
Making new maps for the Aliens of Akutash campaign :)

Hopelyfully they'll be full of fun and action :D

Progress: 1/3 maps done this sesion
Title: Re: What are you working on? :D
Post by: annikk.exe on May 24, 2011, 05:21:05 AM
Made my first new mechanic in a while.  Its one that has been done before in various guises, but I like my implementation more.. :P  obviously I am biased though.

Need to think of a good idea for a map that can use it.  Hmm...
Title: Re: What are you working on? :D
Post by: Pilchard123 on May 24, 2011, 05:36:09 AM
Right. What do we know?

You're in Scotland, so that means you're in the same time zone as me (GMT +- 0)
You only started coding again today - it's a fairly simple thing.
It's been done before.
You need to think of a map idea to use it.

So:
It's not an AI - that's much more than a day's work and it can really be put in any map with a little tweaking.
It's not solely an aesthetic change coz that's not really a game mechanism.
Gravity/collisions? No. Not in a day.
I'm thinking either CC or rallying. Maybe a TD map.

Amirite?
Title: Re: What are you working on? :D
Post by: annikk.exe on May 24, 2011, 06:27:03 AM
Maybe!


Yes.
Title: Re: What are you working on? :D
Post by: annikk.exe on May 24, 2011, 06:40:19 AM
I had an idea that I think would be pretty fun, and would also justify the new mechanic I made today.  It involves a big cluster of asteroids in a rough square or ball.. organically spaced, individually tailoired.  There would be various invasion type scenarios... rotating moons, comet flybys..  The whole thing would be very fast-paced.

I guess I would use Infected AI.. though probably not the Starfield Engine due to CPU constraints, and also because it might be too much visually when the new mechanic is active too.  Gravity would be quite nice here, the asteroid clusters could all be in "sun" mode, and the comets could weave in and out of them.  That might look pretty damn awesome...
Title: Re: What are you working on? :D
Post by: Aino on May 24, 2011, 09:39:07 PM
Whatever it is, I'll beta test it immediatly if possible, when possible :)
Title: Re: What are you working on? :D
Post by: Aino on May 25, 2011, 12:57:53 AM
I think I'll need a tutorial in I/O, I really want to make a saving system, but how??
Title: Re: What are you working on? :D
Post by: annikk.exe on May 25, 2011, 12:58:14 AM
Did a little more on it today.  Refinements to the mechanic's visuals.  Tidied up the lua code a lot and got everything ready to add the asteroids.  Emailed the code to myself so I can work on it later.
Title: Re: What are you working on? :D
Post by: Aino on May 25, 2011, 01:01:06 AM
Lol xD

You e-mailed it to yourself? Awesome... Though I really wanna know what it is D:
Title: Re: What are you working on? :D
Post by: Aino on May 25, 2011, 02:38:19 AM
Ok, I'm ready, for making my Save/Load function... but first something for my campaign :D

It's going to be a totally new game element, though it uses old to make itself new(you probbly don't understand...) :)


Maybe get going with it another day... Right now I begin to get tired :P
Title: Re: What are you working on? :D
Post by: Aino on May 25, 2011, 03:11:33 AM
Although I'll need to know EVERYTHING that is responsible for the gameplay, so people: mind help me?

Just tell me about something that exists in the game, like treecap and seedlings per empire(though, I said them so don't be stupid and post them :))
Title: Re: What are you working on? :D
Post by: annikk.exe on May 25, 2011, 03:12:40 AM
Why don't you just look them up in the Reference thread?
Title: Re: What are you working on? :D
Post by: Aino on May 25, 2011, 03:13:54 AM
yeah, why not? I'm stupid :P
Title: Re: What are you working on? :D
Post by: Aino on May 25, 2011, 03:38:09 AM
Awesome!!!

Fixed the saving :D

Example on totally random map:

Code: [Select]
0|1|0|0|0|100|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|1|0.47816401720047
1|1|0|0|0|100|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|1|0.93597215414047
2|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0.68686866760254
3|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0.29292929172516
4|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0.56565654277802
5|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0.10000000149012
6|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0.88888889551163
7|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0.69696968793869
8|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0.58585858345032
9|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0.17171716690063
10|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0.27272728085518
11|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0.1414141356945
12|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0.75757575035095
13|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0.33333334326744
14|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0.63636362552643
15|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0.31313130259514
16|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0.3737373650074
17|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0.5151515007019
18|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0.13131313025951
19|0|28|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0.98989897966385
20|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0.59595960378647
21|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0.70707070827484
22|0|12|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0.78787881135941
23|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0.47474747896194
24|0|32|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0.38383838534355
25|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0.2323232293129
26|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0.7474747300148
27|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0.66666668653488
28|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0.96969699859619
29|0|17|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0.72727274894714
30|3|0|0|0|0|0|0|0|0|0|20|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|1|0|1|0|0.71717172861099
31|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0.89898991584778
32|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0.82828283309937
33|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0.30303031206131
34|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0.92929291725159
35|2|0|0|0|0|0|0|20|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|1|0|1|0|0.47474747896194
36|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0.53535354137421
37|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0.92929291725159
38|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0.77777779102325
39|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0.88888889551163
40|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0.41414141654968
41|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0.27272728085518

And every single id is pasted with this: ID|owner|seedlings"i"|numflowers"i"|nummines"i"|numdystrees|numdeftrees|visble[player]|coreenergy\n

where when indexed with "i" it's and array spanning for all living empires...
Title: Re: What are you working on? :D
Post by: Pilchard123 on May 25, 2011, 04:07:16 AM
How did you get the IO library to work?
Title: Re: What are you working on? :D
Post by: Aino on May 25, 2011, 05:11:22 AM
Simple, just write
Code: [Select]
io.output(io.open(x .. filename, "w" or "r"))
Where x is file destination, remember \\ not \!

Example: io.output(io.open("D:\\" .. "cool.txt","w"))

and "w" is write, "r" is read.

Now if you wrote you can just make a variable named anything, change it as you want and then add io.write(textvariable)

then after you're done, jsut take in a io.close()

Code: (Example) [Select]
io.output(io.open("D:\\" .. "cool.txt","w"))
local txt = "this is\na cool\nlittle snippet\nfrom fluffyland :D"
io.write(txt)
io.close()

After running it there will be a text file named cool on your D disc :)
Title: Re: What are you working on? :D
Post by: annikk.exe on May 25, 2011, 07:56:55 PM
I haven't tested it myself but presume it works as described.  Well done Aino for solving one of the longstanding problems that none of us have been able to solve :>

That is the first major barrier to saving games dissolved.  The other big problem is, how do you account for seedlings that are mid-flight between asteroids when you save the game?  How do you detect and record their existence, and how do you re-create them when the level is loaded again?



With regard to my own project...  I had some more ideas for it last night which would make it truly original and worthy of being a new annikk map.  As usual they range from incredibly difficult to totally impossible to pull off.  w00t!
Title: Re: What are you working on? :D
Post by: Aino on May 25, 2011, 09:24:01 PM
Well, you can do one thing, make them appear on random asteroids, just count the amount of seedlings the empire have, the numer of seedlings they have in the loaded game and the difference between them will be added to random roids the empire owns, though you'll have to send seedlings again...
Title: Re: What are you working on? :D
Post by: annikk.exe on May 25, 2011, 09:54:54 PM
That could potentially leave the loaded game looking significantly different from the one that was saved, though.  Imagine if you save the game right before your seedlings arrive for a devastating attack on the enemy.  When you reload, your seedlings would be scattered everywhere and not in position for the attack.
Title: Re: What are you working on? :D
Post by: Aino on May 25, 2011, 09:57:07 PM
I know, sad :/ But nothing else you can actually do without finding every seedlings position, and one more thingthat would be crapped is tghat the seedlings won't have the varying attribs :(

But for now I'm making a save/load function for "Tough Collisions" :D
Title: Re: What are you working on? :D
Post by: Aino on May 25, 2011, 10:20:02 PM
Code: [Select]
-0.092614301817784|-0.033666943740996|-0.0015675112872755|-0.00075895622089649|-5.9181165563956e-005|-3.1153533672533e-005|2|1|0.066000000759959|
-66.094856570761|-75.882323731876|-0.00177005091845|0.16381054493077|1.4562314010574e-006|4.4885269368803e-006|1.78|1|2.9939999721944|
-8.8475224795368|-33.804391354459|0.052681760821877|-0.11522255108318|-5.5499821000586e-006|6.8260957899153e-006|1.78|1|0.082000001519918|
1.2463784729883|-75.609026779198|-0.1068262994227|0.17010144972033|-3.1968609870431e-005|1.2109259534869e-005|1.9|1|1.1530000280589|
78.63797036449|61.043499755844|0.073127903462542|0.096889234466921|-4.7110628571054e-005|-1.4736114576687e-005|2.696|1|0.082000001519918|
44.572884178928|38.247044831401|-0.012679897826631|-0.057330794392724|2.8881123357708e-005|4.3639962415557e-005|2.38|1|0.082000001519918|
75.510599849763|18.148281175179|-0.17788871277994|-0.038741802098897|-1.1491766623343e-005|-1.6684903965938e-006|2.06|1|1.2270000252873|
-38.960195775396|46.756176206926|0.063812756214887|0.046060204282989|4.3289812220749e-006|-1.6458391564846e-006|2.26|1|0.64200002811849|
-70.420393459409|22.462400274137|0.042525749917015|0.029119425410296|9.542609146265e-006|1.6230602240458e-005|1.68|1|0.082000001519918|
41.877475129766|73.215157645292|-0.10969354054408|-0.021865929438175|5.440299617117e-006|-1.9690348369526e-005|1.78|1|2.4279999911785|
-26.382650672476|-18.902856193521|-0.059196532615506|0.034467627616724|-1.0582318627099e-005|6.4660490131011e-006|1.62|1|0.70600003115833|
-7.6424160798402|-70.076715151126|-0.14678916246521|-0.057691173411257|3.0707421259163e-006|-1.4947936731156e-006|2.38|1|0.082000001519918|
-61.601044106737|-47.34435976063|0.093019275648765|0.08761447994304|1.5365784766541e-005|1.0249473132916e-005|1.62|1|0.082000001519918|
-80.228755173361|-12.650584112261|0.12835868450721|-0.012514200113014|8.2757081452846e-006|8.6320685601118e-006|1.94|1|0.082000001519918|
23.159969481427|-25.123704104524|-0.16848503553262|0.17494417131664|-1.5021985174732e-006|2.494118343071e-006|2.04|1|0.082000001519918|
79.843032974438|-73.673931942878|0.043409252227917|0.09136489705583|-2.1375542833282e-005|1.0075813621975e-006|2.368|1|0.082000001519918|
-70.684649058975|85.491293231745|-0.13600688459234|0.019052801672317|1.2379577256417e-006|-1.5535329458456e-005|2.24|1|0.082000001519918|
53.588665122706|60.050889050055|0.081933306825834|0.0074376975924834|8.4971062148463e-006|-2.5851442474453e-005|1.6|1|0.082000001519918|
67.582442332479|58.697797157606|-0.046484407922066|-0.016858217191975|-1.2108813632391e-005|-8.502482741794e-006|1.84|1|0.082000001519918|
75.275532269272|-42.123819399824|0.10808454014474|-0.16295351371022|-5.5314294323094e-006|9.8813238791691e-007|2.26|1|0.098000002279878|
-96.453020504494|44.485907906133|-0.042425425878625|0.065861386941521|2.2183326824816e-005|1.4273988943423e-006|1.62|1|0.082000001519918|
-26.906850422729|94.719638278651|-0.086867385657762|-0.017646664958139|-9.1506295324531e-007|-1.0734140841291e-005|2.12|1|0.082000001519918|
64.860245704169|-8.1741652004927|-0.074278597861817|0.043603447692891|-4.1663763204391e-006|5.5069780950268e-007|2.16|1|1.0190000321716|
-8.7805442755023|50.211785486021|0.097493153522531|-0.079866551753526|-4.8018783722441e-005|1.70497655573e-006|1.94|1|0.082000001519918|
-63.223627641602|-25.109169111808|-0.085877903227692|0.13158148683517|8.6717376391042e-006|4.837504082831e-006|1.76|1|0.082000001519918|
50.193716954471|45.845506895218|-0.16972414068949|-0.1477188024367|-3.9401435148776e-006|-1.2101907788115e-006|2.276|1|0.082000001519918|
-6.662916290175|-3.4277490436549|0.14240252833499|0.040412692369575|-5.7842000014941e-006|4.5867795490037e-007|1.74|1|0.082000001519918|
-44.994155990195|-51.897742859361|0.15158169884285|-0.098626468677847|1.6680508214901e-007|2.4303995497445e-006|2.04|1|1.6080000132322|
-90.398741080588|2.4305804203678|-0.12137699095759|0.16749951744541|5.15622300711e-006|3.8034619138075e-006|1.82|1|0.082000001519918|
64.049379844498|-78.936975784796|0.1233569834513|0.093828841219425|-3.3946919454669e-006|1.5558957566087e-008|2.54|1|0.082000001519918|
-66.090660949748|69.728694981785|0.053473086381555|0.15982369558952|-2.6680649098244e-006|-9.0596295973309e-006|1.9|1|0.082000001519918|
-12.533250373412|64.428106952572|0.011479058410825|-0.18886537050484|-6.5940394295006e-006|-1.3352607016622e-005|1.9|1|0.70600003115833|
-85.211584862106|99.67482003335|-0.098557998943147|0.09461288342725|1.1198509368721e-006|-3.4241843300381e-006|2|1|0.082000001519918|
-77.566312208915|-89.734268845128|-0.12190846067966|0.028854750168995|1.4981372417308e-006|1.1246646006092e-006|2.22|1|0.082000001519918|
11.929676879481|-94.213564788347|-0.2145489973698|0.058263283048193|-4.4650559728191e-005|5.0112679703102e-006|2.4|1|2.861999976635|
-63.400833246456|34.781011866306|-0.052928554116572|-0.17586651808218|-5.6044342593024e-006|6.4603720818261e-006|1.9|1|0.082000001519918|
2.9693886078101|-93.454970297293|0.15249466131222|-0.10487910206626|-3.5210527877053e-007|7.5803432812334e-007|1.86|1|0.082000001519918|
-78.160989442637|48.782550860722|-0.013745778640769|-0.13426474610804|1.511732529903e-006|-7.8928959572435e-007|2.32|1|0.082000001519918|
-18.207839304874|47.740003065472|-0.18814659906143|0.14538825926628|-4.0479713097143e-007|-9.4493092799253e-007|1.94|1|0.082000001519918|
-43.59539314518|-11.381886899287|0.020916640384232|0.18991773647627|0|0|2.14|1|0.082000001519918|

Done, now to the loading... loading... grr...
Title: Re: What are you working on? :D
Post by: annikk.exe on May 25, 2011, 11:25:57 PM
Well there is a way to reference an array of seedlings or "agents" when they are orbiting an asteroid.  Perhaps you can query these even in mid-flight, and check what their attributes and x/y positions are.

I wouldn't just give up because it looks hard...  especially when you've already got yourself halfway there..

By the way that save file looks insanely complicated :P
Title: Re: What are you working on? :D
Post by: Aino on May 25, 2011, 11:58:35 PM
Nahh, it isn't complicated at all(the savefile!), it is just split up with attributes separated with  "|" :)

So the game should recognize it, but I got problems with reading a line x(

I can give the code, if anyone wanna look into it :)
Title: Re: What are you working on? :D
Post by: annikk.exe on May 26, 2011, 12:32:33 AM
Witness my rambling!  Trying to think of some good random events.

1.  Initial colonisation battles...
2.  Comet flyby with enemies jumping off.
3.  Rotating moon(s) around the entire belt, enemies jumping off.
4.  Black holes suck nearby units into oblivion - player must run their units around to avoid these wandering monsters.
5.  Dimensional eclipse - sun goes black - player cannot grow any units for a period of time (this would be in combination with an invasion event)
6.  Tanky or high-dps rogue lasermine interventions from 2) or 3)



I'm thinking 15-20 asteroids for the central belt.  10 units to build or upgrade a tree.  Upgrades could be random; range, damage, health, number of lasers.  Stats could be randomised upon initial planting; use a random slot filling technique to calculate attributes based on asteroid size.

Randomise the asteroid size?  Hmm, no.  That would cause serious trajectory problems for the comet fly-by.

How to create a mines-instead-of-seeds for planting mechanic?  I'd still want to use the Build Tree button.  Shoudl I actually let the trees grow?  Maybe.  I can set the number of seeds required to equal 5000 when no mines are present, but 0 when there are suffiicient mines.  I'll have to create all of the mines manually so I can refer to them, I guess.  Building a tree destroys 10 mines.

Hmm.  This is all a bit ambitious.  Need to make the asteroid field first.
Title: Re: What are you working on? :D
Post by: Aino on May 26, 2011, 01:02:37 AM
Nice, I guess... I can't imagine all that at once xD

But I jsut found out that I need a new format! All variables at each line! :D Perfect huh? Size consuming? Both! :D
Title: Re: What are you working on? :D
Post by: Aino on May 26, 2011, 01:13:36 AM
And one more awesome thing I've donne with the saving system is to make it automatically make a saving folder, it's named EufloriaSaves and is located directly at the C drive :)

So if any of you wanna use that, jsut copy this crap over:

Code: [Select]
if not io.open(BasicSaveFolder .. "acces.acces") then
os.execute("mkdir " .. BasicSaveFolder)
io.output(io.open(BasicSaveFolder .. "acces.acces", "w"))
io.write("Don't delete this file unless you want to remove the Eufloria Saves. Thank you!")
io.close()
end

Where BasicSaveFolder = "C:\\EufloriaSaves\\"

I don't know if this is only compatible with windows, if so I'm sorry :/
Title: Re: What are you working on? :D
Post by: Aino on May 26, 2011, 01:25:51 AM
It worked at first try! It's amazing :D

So now to update the map :P
Title: Re: What are you working on? :D
Post by: Pilchard123 on May 26, 2011, 02:22:31 AM
Imma guess that \ is the Lua escape character then?

Also, I made a black hole template that should still work if you don't want to make your own.
Title: Re: What are you working on? :D
Post by: Aino on May 26, 2011, 02:25:23 AM
Heh, I just make them black holes for fun... And hoping they won't come to earth...

Just do whatevery you want, right now I don't want to claim to do something here on the forum :)
Title: Re: What are you working on? :D
Post by: Aino on May 26, 2011, 02:47:31 AM
Ok, gonna make an even more feature rich save system, quicksave and quickload/loadlast :D
Title: Re: What are you working on? :D
Post by: Pilchard123 on May 26, 2011, 03:01:23 AM
Just a thought - how is this going to work with other stuff? Y'know, like IAI, AAI, blackholes, gravity etc.
Title: Re: What are you working on? :D
Post by: Aino on May 26, 2011, 03:07:31 AM
Well, The save works simple, you store all the infor you want to store in a file, so for each attribute or anything, you just add something.

Code: [Select]
io.output(io.open(BasicSaveFolder .. savename .. ".TCS", "w"))
local txt = "truesave\n"
for i = 1,NumDrawings do

txt = txt .. Px[i] .. "\n"
txt = txt .. Py[i] .. "\n"
txt = txt .. Vx[i] .. "\n"
txt = txt .. Vy[i] .. "\n"
txt = txt .. Ax[i] .. "\n"
txt = txt .. Ay[i] .. "\n"
txt = txt .. Mass[i] .. "\n"
if Drawn[i] == true then
txt = txt .. "1" .. "\n"
else
txt = txt .. "0" .. "\n"
end
if IsAlive[i] == true then
txt = txt .. "1" .. "\n"
else
txt = txt .. "0" .. "\n"
end
if i < NumDrawings then
txt = txt .. SpawnP[i] .. "\n"
else
txt = txt .. SpawnP[i]
end

end
io.write(txt)
io.close()

This is a part of the saving system, as you see it stores all the attributes of the dots on each line, you can just add more and more attributes in here. So for gravity, well just add it in and you end up with gravity... So what I mean is that the system is very dynamic :)
Title: Re: What are you working on? :D
Post by: annikk.exe on May 27, 2011, 09:34:36 PM
Will be releasing a new map-making tool later today.
Title: Re: What are you working on? :D
Post by: Aino on May 27, 2011, 09:49:18 PM
A map making tool o.O

So thats the new mechanic :D
Title: Re: What are you working on? :D
Post by: annikk.exe on May 27, 2011, 09:55:06 PM
Nah, this is seperate to the new mechanic I made.

I decided to make a map-making tool because I can't be bothered figuring out the coordinates asteroids should go at.  So I've made a point-and-click asteroid positioner and sizer.  When you're finished you click a button and it will dump the code to make that configuration of asteroids to a file.
Title: Re: What are you working on? :D
Post by: Aino on May 27, 2011, 10:08:50 PM
And it works properly? :)
Title: Re: What are you working on? :D
Post by: annikk.exe on May 27, 2011, 10:38:29 PM
See for yourself.  :>
Title: Re: What are you working on? :D
Post by: dragoonreas on May 28, 2011, 12:15:25 AM
Ok, gonna make an even more feature rich save system, quicksave and quickload/loadlast :D

I was looking over the functions in the Eufloria Lua scripting reference post here (http://www.dyson-game.com/smf/index.php?topic=212.msg1862#msg1862) and was wondering what stats the following two functions saved and loaded, and whether or not there is any overlap between what stats you're trying to save manually.
Code: [Select]
SaveStats(string filename) e.g. SaveStats("myfile.bin") - saves out the current game stats to the given file
LoadStats(string filename) e.g. LoadStats("myfile.bin") - loads myfile.bin into the current stats register
Title: Re: What are you working on? :D
Post by: annikk.exe on May 28, 2011, 12:25:25 AM
I think they save things like how many levels you've completed, which achievements you've completed, etc.  The stuff we're saving for this is the position and size of asteroids.
Title: Re: What are you working on? :D
Post by: Aino on May 28, 2011, 12:37:13 AM
And the files you get are completely useless for my purpose :)
Title: Re: What are you working on? :D
Post by: annikk.exe on May 30, 2011, 03:53:48 PM
Spent some time working on the new level last night.  Going well so far.  :>
Title: Re: What are you working on? :D
Post by: Aino on May 30, 2011, 05:13:27 PM
Aww, I wanna see what it is D:
Title: Re: What are you working on? :D
Post by: annikk.exe on May 30, 2011, 05:28:16 PM
Well, the thing I was working on most recently was figuring out a way that Mines can be grown from trees.. and how to plant a tree using 10 mines.  That part is working good.  :>  I also did some testing on ordering the mines to move around... that part doesn't work quite how I'd like it, but I might be able to figure out a solution there..
Title: Re: What are you working on? :D
Post by: Aino on May 30, 2011, 05:35:58 PM
That might be hard... I got no real idea without getting into not working or crash... Moving mines with triggering doesn't seem to work so good, but I dunno...
Title: Re: What are you working on? :D
Post by: annikk.exe on May 30, 2011, 07:44:01 PM
Well, if I tell a bunch of mines to go to an asteroid, they do it.

The problem is that they ignore the send distance of the asteroid they are travelling from, and just go straight towards the destination asteroid without having to cross the intervening asteroids first like seedlings would.

This behaviour is a bug with the mine:SendTo() command unfortunately.
Title: Re: What are you working on? :D
Post by: annikk.exe on May 30, 2011, 09:25:18 PM
I spoke with Rudolf today, apparently he and Alex are about a week away from finishing the PSN port.  They are currently doing final level tweaks, bug fixes, and preparing for the submission to Sony QA.
Title: Re: What are you working on? :D
Post by: Aino on May 30, 2011, 09:34:09 PM
Great! Can't wait :D
Title: Re: What are you working on? :D
Post by: Aino on May 31, 2011, 10:48:05 PM
Yay, working on a 2D blocky "game", like minecraft and terraria...
Title: Re: What are you working on? :D
Post by: Aino on May 31, 2011, 10:55:18 PM
And it looks alright already, got infinite terrain and stuff, jsut gotta fix two things: making terrain look nice and not so totally random(though it is random o.O) and gravity/collision through objects...
Title: Re: What are you working on? :D
Post by: Aino on June 09, 2011, 10:49:47 PM
Aww, I got no imagination anymore D:

I can't even code a map :/
Title: Re: What are you working on? :D
Post by: annikk.exe on June 09, 2011, 11:28:11 PM
I am working on Deactivated Pseudo-Vertices!  Intersecting plane management!  And other neat stuff.  :>
Title: Re: What are you working on? :D
Post by: Pilchard123 on June 09, 2011, 11:50:23 PM
I am releasing a new function!
Title: Re: What are you working on? :D
Post by: annikk.exe on June 10, 2011, 08:58:58 PM
Today I have focused on three things:


1) Tidying up the 3D Engine so it's neat and concise, before I start working on faces..

2) Modifying the 3D Engine so that it will accept copy+pasted objects without any additional code changes.

3) Planning an overall structure for the face-inclusive code:


Code: [Select]
-- Initialise the level, globals, etc
-- Initialise variables, arrays and matrices
-- Initialise object(s)

-- Perform any transforms as required
-- Calculate new 2dX and 2dY positions of all vertices
-- Calculate Vertex Visibility
-- Edge-to-Face check - are any edges intersecting faces?
-- Edge-to-Edge check - are any edges intersecting other edges?
-- Edge-to-Roid check - are any edges intersecting asteroids?
-- Calculate Pseudo-Vertex Visibility

-- Draw Vertices
-- Draw Edges



Variables

numberofvertices -- Total number of vertices.  Object templates should increment this number with each added vertex.
numberofasteroids -- Total number of asteroids in the level (calculated)
spriteindex -- The ID of the sprite used for drawing vertices (specified)
zscalefactor -- How "zoomed" is the camera.  The larger the value, the more zoomed in. (specified)


Arrays

vertex2dX -- 2D coordinates of the vertex (calculated)
vertex2dY
vertex3dX -- 3D coordinates of the vertex (specified)
vertex3dY
vertex3dZ
vertex3dXtransformed -- Resultant coordinates from any applied transforms (calculated and drawn)
vertex3dYtransformed
vertex3dZtransformed
SetVertexSize -- How big should the vertices look? (specified)
vertexsize -- The actual rendered size of vertices once distance from the camera is considered (calculated)
red -- Vertex colour (specified)
green
blue
threshold -- How zoomed out before each individual vertex starts to lose alpha? (specified)


Matrices

edge -- Columns contain Edge ID's, rows contain participating vertices
face -- Columns contain Face ID's, rows contain participating edges
Title: Re: What are you working on? :D
Post by: Aino on June 14, 2011, 03:39:48 AM
Working on somethuing secret... It is similar to Gravity in some ways...
Title: Re: What are you working on? :D
Post by: annikk.exe on June 16, 2011, 12:39:34 AM
The vertex visibility problem has got me stumped. :S
It should work.... I have theorycrafted out all the formulas used and it works for sample data written out on paper..  but the observed behaviour is different from what is expected.

I need a breakthrough.
Title: Re: What are you working on? :D
Post by: Pilchard123 on June 16, 2011, 12:46:10 AM
What's the problem, exactly?

EDIT:Ha... I'm having trouble in my computing lessons. I keep putting Lua constructs into VB.NET programs. And looking like an idiot.
Title: Re: What are you working on? :D
Post by: Aino on June 16, 2011, 03:52:03 AM
Lol Pilchard xD

I can't wait til I start with computer science, though it is 5 years to wait...
Title: Re: What are you working on? :D
Post by: Aino on June 16, 2011, 04:08:10 AM
Dropped my idea, It was about waves pushing asteroids, making a randomly changing asteroid field...

New idea: Some kind of adventure thing, with quests(Eufloria style :D)

What I want:

 - Some kind of randomly generated asteroidfield, maybe even several :)
 - A SFX generator, like mists and... stuff...
 - Random quests, so each time you do the map, you'll get different objectives
 - A neat display for the objectives :D
 *The objectives thing needs an engine to do that stuff, maybe I could even save it on the harddrive, so when you play there will be some positive and negative things happening?

What I need to do(hate this list :P):

 - A random terrain generator, capable of generating neat and organic asteroidfields, but still there will be something nifty and scary(not achieveable in Eufloria(flowerpower :D) :/) things and places...
 - An Objective generator, storer, displayer, tracker and starter, this might be done in fewer functions tough :P).
 - Create a SFX... thing...
Title: Re: What are you working on? :D
Post by: Bonobo on June 16, 2011, 05:30:37 AM
@Aino: Check out the map “Project Asteroids”  by Crypton, if you haven’t done so yet, IIRC this created a new asteroid field every time, maybe it can be of some help?

http://www.dyson-game.com/smf/index.php?topic=695.msg4022;topicseen#msg4022
Title: Re: What are you working on? :D
Post by: Aino on June 16, 2011, 05:31:35 AM
Bonobo, for me it only creates a filled circle of asteroids...

I'm more interested in Annikks EverSwarm map generator...
Title: Re: What are you working on? :D
Post by: annikk.exe on June 16, 2011, 05:58:18 AM
EverSwarm was successful in addressing some very complicated problems like creating a field of asteroids that are all interconnected.  However there _is_ a pattern to the levels it generates, and there is room for improvement.  Dig in!  Ask questions if you're unsure of anything in the Everswarm code.. :>

I fixed a bug with the cube - one of the faces was misdeclared.  I've also enabled all the faces now, and there is definitely something still wrong with the vertex visibility.
Going to have a think about it tonight.
Title: Re: What are you working on? :D
Post by: Aino on June 16, 2011, 06:00:11 AM
Good job annikk, and I'll see what I can do with EverSwarm :)

Thanks for letting me use it I guess then :D

Edit: Ugghh, been working on the SFX part for my adventure map, and it's only halfway done... I haven't even tested it :/

But I have all day :P
Title: Re: What are you working on? :D
Post by: Aino on June 16, 2011, 03:27:15 PM
Now it is done, it worked on the first try, so I'm really happy... Now to the quest, but school first :o
Title: Re: What are you working on? :D
Post by: annikk.exe on June 16, 2011, 05:42:40 PM
So vertex visibility is totally fixed and working now.  The only thing left to do for it, is looking like it's going to be the hardest part so far.  That is, checking whether a vertex that is detected inside a face is further away from the camera than the face itself.

That will involve finding the equation for a plane based on 3 coordinates, and finding the intersection between a line and a plane in the 3D system.  I found some videos about that last night and it is definitely not trivial looking stuff..
Title: Re: What are you working on? :D
Post by: Aino on June 16, 2011, 09:35:09 PM
Need ideas for quests :)

Got theese on my mind:

Title: Re: What are you working on? :D
Post by: annikk.exe on June 16, 2011, 09:42:38 PM
Destroy as many crates as possible within 30 seconds.
Gather X amount of resources within a given time.
Rescue the baby dragon from the clutches of the evil princess!

Dunno..
Title: Re: What are you working on? :D
Post by: Aino on June 16, 2011, 09:51:19 PM
Ughh...

Annikk, this is about my adventure mode ghameplay for Eufluria :)

So gathering more units than the enemies(faster too) could be a sub-challenge(like in-game...)
Title: Re: What are you working on? :D
Post by: annikk.exe on June 16, 2011, 10:02:35 PM
But you have crates, right?  I think that there should be crates.  :>
Title: Re: What are you working on? :D
Post by: Aino on June 16, 2011, 10:05:29 PM
I don't think there is any crates in Eufloria D:

Eufloria! Y U NO have crates?!
Title: Re: What are you working on? :D
Post by: annikk.exe on June 16, 2011, 10:08:35 PM
Eufloria does indeed lack crates.
But not for long... :>
Title: Re: What are you working on? :D
Post by: Aino on June 16, 2011, 10:21:01 PM
Why so?

We've gone from on topic to off topic already xD
Title: Re: What are you working on? :D
Post by: Aino on June 16, 2011, 10:24:56 PM
Working on quests, beginning the map with some fancy "newbie" maps, which will test your skills somehow, after that you'll get random missions :P

Code: [Select]
function CreateMainQuest()

if MissionsDone == 0 then

MissionID = "beginner"
MissionObjective = "Gather 100 seedlings without dying"
MapType = "classic"

elseif MissionsDone == 1 then

MissionID = "proving"
MissionObjective = "Kill all three enemies without dying"
MapType = "triangle"

elseif MissionsDone == 2 then

MissionID = "testing"
MissionObjective = "Defend from waves without loosing any asteroids for 5 mins"
MapType = "fortress"

else

MissionID = "random"
MissionObjective = "not determined"
MapType = "random"

end

end

Looking good? Mind that that is actually directly from the code xD
Title: Re: What are you working on? :D
Post by: annikk.exe on June 16, 2011, 10:39:14 PM
Looks interesting.. :>  And sounds complicated!  Hope you've spent lots of time planning it...  I am a big fan of planning, as you can probably tell from the amount of stuff I've written about the 3D engine.  :P
Title: Re: What are you working on? :D
Post by: Pilchard123 on June 17, 2011, 02:12:26 AM
Try generating  fractal patern of roids.
Title: Re: What are you working on? :D
Post by: dragoonreas on June 17, 2011, 02:23:10 AM
Try generating  fractal patern of roids.
You mean using a tree fractal like this (http://www.dyson-game.com/smf/index.php?topic=915.0)?

… I really need to find the time to finish that at some point. :-\
Title: Re: What are you working on? :D
Post by: annikk.exe on June 17, 2011, 02:30:40 AM
A tree fractal isn't random.. :>  But with that said, I really like mathematically-generated levels.  The spiral in Infected Empire is my all-time favourite.. :>

Also, technically Everswarm isn't random either.  Nothing is random... :p  ./philosopher
Title: Re: What are you working on? :D
Post by: Aino on June 17, 2011, 02:47:08 AM
I'll doa nything you guys ask for, I wanna make it some kind of thing you can play 5 times and still be amazed(excluding the starts though...)

I also got plans for reinforcements, like you can place an extra amount of seedlings on the next time you play, for each time you get around 10% of the amount of seedlings you gathered max, so 4k is 400...

I wanna do portals, but because of the removing thing is crashy and unstable I won't use it... And ofcourse I'll make bridges ;D
(I fyou wonder what bridges are in Eufloria, it is a controllable asteroid that moves when another asteroid isn't being watched... Use yuo imagination to sere it :P)
Title: Re: What are you working on? :D
Post by: Aino on June 17, 2011, 02:48:10 AM
This will take time and thinking, the best part about coding, the worst part is debugging and troubleshooting...
Title: Re: What are you working on? :D
Post by: annikk.exe on June 17, 2011, 03:11:26 AM
Every hour you spend planning reduces the troubleshooting time by 3.. :>
Title: Re: What are you working on? :D
Post by: Aino on June 17, 2011, 03:19:01 AM
You've told me before, and I've already gone through it... But my coding begins to get auto, so it works often at first attempt o.O

But there is alot going on in my head as I code, I look for problems, possible changes and neccesary ones... Sometimes though, I get errors I don't understand, cause I've never seen such a situation, like just now I had to put and end after a return() becuase it was in a for loop I think, I never did anything, so I don't know for sure :o
Title: Re: What are you working on? :D
Post by: Aino on June 17, 2011, 03:23:30 AM
Now as we are ohn it, why doesn't this code work?

Code: [Select]
function Load()
if io.open(BasicSaveFolder .. "Adventure.EURI", "r") then

local file = assert(io.open(BasicSaveFolder .. "Adventure.EURI", "r"))

local curline = 1

GameSaveInfo = {}
for line in file:lines() do
GameSaveInfo[curline] = line
curline = curline + 1
end

end
end

Error:
"Index was out of range. Must be non-negative and less than size of collection. Parameter name: index"

But when I add more lines to the save myself, it still ain't workin'...
Title: Re: What are you working on? :D
Post by: annikk.exe on June 17, 2011, 03:28:28 AM
Hmm, can you explain what this line says?

Code: [Select]
for line in file:lines() do
Title: Re: What are you working on? :D
Post by: Aino on June 17, 2011, 03:30:59 AM
For each line in the file, do something... magically the output line in each loop is the text in the line :D
Title: Re: What are you working on? :D
Post by: Aino on June 17, 2011, 04:04:31 AM
Still need help though -.-

This problem was very unexpected and I don't see how to fix it... *sigh*
Title: Re: What are you working on? :D
Post by: annikk.exe on June 17, 2011, 05:55:36 PM
Well, if you really have no idea what is going wrong, comment out tons of your code and see if it works then.  If it's still not working, comment out some more.
Once you have a level that loads, start un-commenting things bit by bit, until you find the part that stops it from loading.  Usually this method will eventually let you boil the problem down to a single line of code.  :>
Title: Re: What are you working on? :D
Post by: Aino on June 17, 2011, 07:42:51 PM
Code: [Select]
function GetGameSaveInfo(wline)
if io.open(BasicSaveFolder .. "Adventure.EURI", "r") then

local file = assert(io.open(BasicSaveFolder .. "Adventure.EURI", "r"))

local curline = 1

for line in file:lines() do
if curline == wline then
local reqline = line
break
else
curline = curline + 1
end
end

local linetoreturn = reqline

elseif wline == 1 then

local linetoreturn = 0

end

return linetoreturn
end

The newest code...

The "return" is the problem, but why is it causing the problems?
Title: Re: What are you working on? :D
Post by: annikk.exe on June 17, 2011, 09:01:19 PM
Try declaring linetoreturn as a global variable, rather than local.  Don't know if that will fix it or not though..
Title: Re: What are you working on? :D
Post by: dragoonreas on June 17, 2011, 09:56:22 PM
It looks like you're trying to use the local variables linetoreturn and reqline outside of the blocks you declared them in.
This (http://www.lua.org/manual/5.1/manual.html#2.6) will tell you about the visibility rules of variables in Lua.

Try this (I'll leave you to decide whether or not the two variables need to be initialised at declaration):
Code: [Select]
function GetGameSaveInfo(wline)
local linetoreturn

if io.open(BasicSaveFolder .. "Adventure.EURI", "r") then

local file = assert(io.open(BasicSaveFolder .. "Adventure.EURI", "r"))

local curline = 1

local reqline

for line in file:lines() do
if curline == wline then
reqline = line
break
else
curline = curline + 1
end
end

linetoreturn = reqline

elseif wline == 1 then

linetoreturn = 0

end

return linetoreturn
end

Title: Re: What are you working on? :D
Post by: annikk.exe on June 17, 2011, 10:05:36 PM
For the last few days, I've been thinking about a new feature I might add after I've finally finished doing this Faces shenanigans..

I was thinking about adding reflections.  You could specify that a particular face is shiny, and then draw lines on the face based on the positions of other objects in front of it.

How to make a good lookign reflection, though?

Well I had figured to have a very thin central line with an alpha of maybe 40%... and a thicker line over the top of it, with alpha 10%.. or something.
That would hopefully give a sort of diffuse glow to the thing.

Obviously the maths would be totally insane, but eh..
Title: Re: What are you working on? :D
Post by: Pilchard123 on June 18, 2011, 01:08:25 AM
I'm fairly sure the thing is amazing enough as it is...

EDIT: Also a semi-accepted golf match to create a code to check if a number is perfect or not. This may devolve into a whole tournament involving equally pointless programs.

Plus side, the guy doesn't use GOTO statements anymore.
Title: Re: What are you working on? :D
Post by: Aino on June 18, 2011, 01:37:17 AM
It's working fine now it seems, but why is local variables affecting the return? And the error message was very missleading, telling something about that the number had to be non-negative...

Anyways, thanks... Now I can finally code the maps, and I want as many map types as possible :)


DERP!!

It ain't working after all -.-
Title: Re: What are you working on? :D
Post by: Aino on June 18, 2011, 02:03:32 AM
I acctually want to add the possability to do maps outside of the lua, doing so it runs from text files instead, much better and cleaner :P
Title: Re: What are you working on? :D
Post by: annikk.exe on June 18, 2011, 09:33:15 AM
In the morning, I get to coding.  Lets implement this thing !
Title: Re: What are you working on? :D
Post by: Aino on June 18, 2011, 08:23:09 PM
just got a cool idea for a map, you do the Solar Conquest map generator, andf then have the capturing alike risks, but not eh spawning... After so, you must plant a fertilizer(custom tree :D) on the asteroid, which then increases the treecap to 3 after time(from 0 to 3!) :)
Title: Re: What are you working on? :D
Post by: Aino on June 18, 2011, 11:00:30 PM
I still need help with the loading thing, here is the code:

Code: [Select]
function LevelSetup()

Globals.G.Asteroids=0
Globals.G.EnemyFactionsMin=0
Globals.G.EnemyFactionsMax=0
SetBackdropColour(0,0,0)
Globals.G.GreysProbability = 0
Globals.G.GreysMin=0
Globals.G.GreysMax=0

CreateFolders()

SFXInit()
BasicSaveFolder = "C:\\EufloriaSaves\\"
MissionsDone = 2
CreateMainQuest()
CreateMap()

if AIType == "infected" then
AIinit()
elseif AIType == "alien" then
AAIInit()
end
end

function SFXInit()

NumSFXs = -1

SFXPx = {}
SFXPy = {}
SFXColorAndSize = {}
SFXCurrentChange = {}
SFXChanging = {}
SFXIsActive = {}

end

function CreateSFX(x,y,r,g,b,a,size,rd,gd,bd,ad,sized,rcs,gcs,bcs,acs,scs)

NumSFXs = NumSFXs + 1

--For the matrix: 1 = the base color, 2 = the amount of change possible, 3 = the current amount of change and 4: the speed of change

SFXColorAndSize[NumSFXs] = {}
SFXColorAndSize[NumSFXs][1] = {}
SFXColorAndSize[NumSFXs][2] = {}
SFXColorAndSize[NumSFXs][3] = {}
SFXColorAndSize[NumSFXs][4] = {}
SFXCurrentChange[NumSFXs] = {}

SFXPx[NumSFXs] = x
SFXPy[NumSFXs] = y
SFXColorAndSize[NumSFXs][1][1] = r
SFXColorAndSize[NumSFXs][1][2] = g
SFXColorAndSize[NumSFXs][1][3] = b
SFXColorAndSize[NumSFXs][1][4] = a
SFXColorAndSize[NumSFXs][1][5] = size
SFXColorAndSize[NumSFXs][2][1] = rd
SFXColorAndSize[NumSFXs][2][2] = gd
SFXColorAndSize[NumSFXs][2][3] = bd
SFXColorAndSize[NumSFXs][2][4] = ad
SFXColorAndSize[NumSFXs][2][5] = sized
SFXColorAndSize[NumSFXs][3][1] = r
SFXColorAndSize[NumSFXs][3][2] = g
SFXColorAndSize[NumSFXs][3][3] = b
SFXColorAndSize[NumSFXs][3][4] = a
SFXColorAndSize[NumSFXs][3][5] = size
SFXColorAndSize[NumSFXs][4][1] = rcs
SFXColorAndSize[NumSFXs][4][2] = gcs
SFXColorAndSize[NumSFXs][4][3] = bcs
SFXColorAndSize[NumSFXs][4][4] = acs
SFXColorAndSize[NumSFXs][4][5] = scs
SFXCurrentChange[NumSFXs][1] = 1
SFXCurrentChange[NumSFXs][2] = 1
SFXCurrentChange[NumSFXs][3] = 1
SFXCurrentChange[NumSFXs][4] = 1
SFXCurrentChange[NumSFXs][5] = 1
SFXIsActive[NumSFXs] = true

if SFXColorAndSize[NumSFXs][2][1] ~= nil then
if SFXColorAndSize[NumSFXs][2][2] ~= nil then
if SFXColorAndSize[NumSFXs][2][3] ~= nil then
if SFXColorAndSize[NumSFXs][2][4] ~= nil then
if SFXColorAndSize[NumSFXs][2][5] ~= nil then
SFXChanging[NumSFXs] = true
end
end
end
end
end

end

function ChangeActiveState(id,bool)

SFXIsActive[id] = bool

end

function LevelDraw()

if NumSFXs >= 0 then
for i = 0,NumSFXs do
if SFXIsActive[i] == true then
local r = SFXColorAndSize[i][1][1]
local g = SFXColorAndSize[i][1][2]
local b = SFXColorAndSize[i][1][3]
local a = SFXColorAndSize[i][1][4]
local s = SFXColorAndSize[i][1][5]

if SFXChanging[i] == true then

SFXColorAndSize[i][3][1] = SFXColorAndSize[i][3][1] + SFXColorAndSize[i][4][1]*SFXCurrentChange[i][1]
SFXColorAndSize[i][3][2] = SFXColorAndSize[i][3][2] + SFXColorAndSize[i][4][2]*SFXCurrentChange[i][2]
SFXColorAndSize[i][3][3] = SFXColorAndSize[i][3][3] + SFXColorAndSize[i][4][3]*SFXCurrentChange[i][3]
SFXColorAndSize[i][3][4] = SFXColorAndSize[i][3][4] + SFXColorAndSize[i][4][4]*SFXCurrentChange[i][4]
SFXColorAndSize[i][3][5] = SFXColorAndSize[i][3][5] + SFXColorAndSize[i][4][5]*SFXCurrentChange[i][5]

for j = 1,5 do

if SFXCurrentChange[i][j] == 1 then
if SFXColorAndSize[i][3][j] > SFXColorAndSize[i][1][j]+SFXColorAndSize[i][2][j] then
SFXCurrentChange[i][j] = -1
end
elseif SFXCurrentChange[i][j] == -1 then
if SFXColorAndSize[i][3][j] < SFXColorAndSize[i][1][j]-SFXColorAndSize[i][2][j] then
SFXCurrentChange[i][j] = 1
end
end
end

r = SFXColorAndSize[i][3][1]
g = SFXColorAndSize[i][3][2]
b = SFXColorAndSize[i][3][3]
a = SFXColorAndSize[i][3][4]
s = SFXColorAndSize[i][3][5]

end

if a > 0 then
DrawSprite(1,SFXPx[i],SFXPy[i],r,g,b,a,s)
end
end
end
end
end

function SaveGameStats()

io.output(io.open(BasicSaveFolder .. "\\Adventure\\Adventure.EURI", "w"))
local txt = tostring(MissionsDone) .. "\n"
io.write(txt)
io.close()
end

function GetGameSaveInfo(wline)
if io.open(BasicSaveFolder .. "\\Adventure\\Adventure.EURI", "r") then

local file = assert(io.input(io.open(BasicSaveFolder .. "\\Adventure\\Adventure.EURI", "r")))

local curline = 1

for line in file:lines() do
if curline == wline then
reqline = line
end
curline = curline + 1
end

elseif wline == 1 then

reqline = 0

end

return reqline
end

function CreateMainQuest()

if MissionsDone == 0 then

MissionObjective = "Gather 100 seedlings without dying"
MapType = "classic"

elseif MissionsDone == 1 then

MissionObjective = "Kill all three enemies without dying"
MapType = "triangle"

elseif MissionsDone == 2 then

MissionObjective = "Defend from waves without loosing any asteroids for 5 mins"
MapType = "fortress"

else

MissionObjective = "not determined"
MapType = "random"

end

end

function CreateMap()

if MapType == "classic" then

for i = 0,math.random(10,20) do

a = AddAsteroid(math.random(-10000,10000),math.random(-10000,10000))

if i == 0 then
a.Owner = 1
a:AddDysonTree()
a:AddSeedlings(10)
elseif i == 4 then
a.Owner = 2
a:AddDysonTree()
a:AddSeedlings(10)
else
if math.random() > 0.7 then
a.Owner = math.random(1,2)
a:AddDysonTree()
a:AddSeedlings(10)
else
a.Owner = 0
end
end

end

OpeningText = "You play a classic random map, this one contains nothing of special stuff!\n\nKill the enemy and win, they might have more than you, or less!"
MapTime = nil
Win = "conquest"
AIType = "normal"

elseif MapType == "triangle" then

local owner = 2

for i = 1,3 do

local a = AddAsteroidWithAttribs(math.cos((i/3)*(math.pi*2))*10000,math.sin((i/3)*(math.pi*2))*10000,0.8,0.8,0.8)

a.Owner = owner
a:AddDysonTree()
a:AddSeedlings(50)

owner = owner + 1

end

local numextra = math.random(20,30)

for i = 0,numextra do

local x = math.random(-10000,10000)
local y = math.random(-10000,10000)

local a = AddAsteroid(math.random(-10000,10000),math.random(-10000,10000))

if i == 0 then
a.Owner = 1

a:AddDysonTree()
else
a.Owner = 0
end
a:AddSeedlings(20*a.Owner+math.random(0,10))

end

OpeningText = "Kill the three empires that tries to kill you, be warned as their main asteroid is very highly attributed!"
MapTime = nil
Win = "conquest"
AIType = "normal"

elseif MapType == "fortress" then

local fortx = math.random(-10000,10000)
local forty = math.random(-10000,10000)

local fortsize = math.random(2000,2500)

a = AddAsteroidWithAttribs(fortx,forty,1,1,1)

a.Owner = 1
a.TreeCap = 5
a:AddSeedlings(100)
a:AddDysonTree()
a:AddDysonTree()
a:AddDysonTree()
a:AddDysonTree()
a:AddDysonTree()
a.Moveable = false

for i = 1,5 do

a = AddAsteroidWithAttribs(fortx+math.cos((i/5)*(math.pi*2))*fortsize,forty+math.sin((i/5)*(math.pi*2))*fortsize,0.8,0.8,0.8)
a.Owner = 1
a:AddDysonTree()
a:AddSuperSeedlings(5)
a.TreeCap = 2
a.Moveable = false

end

for i = 1,20 do

a = AddAsteroid(math.random(-10000,10000),math.random(-10000,10000))
a.Owner = 2
a:AddSeedlings(20)
a.TreeCap = 8
a:AddDysonTree()
a:AddDysonTree()
a:AddDysonTree()
a:AddDysonTree()
a:AddDysonTree()
a:AddDysonTree()
a:AddDysonTree()
a:AddDysonTree()

end

OpeningText = "Watch out for incoming attacks on your fort...\n\nCan you stand against the infected AI for five minutes?"
MapTime = 60*5
Win = "timeout"
AIType = "infected"

end
end

function CreateFolders()

os.execute("mkdir " .. BasicSaveFolder .. "\\Adventure")
os.execute("mkdir " .. BasicSaveFolder .. "\\Adventure\\Maps")

end

function LevelLogic()

if MapTime ~= nil then
GameLast = GetGameTime() + MapTime
end

GameTime = GetGameTime()
while GameRunning() do
if GameTime < GetGameTime() then
GameTime = GetGameTime()

SaveGameStats()

if AIType == "infected" then
InfectedAIEngine()
elseif AIType == "alien" then
AAIEngine()
elseif AIType == "both" then
InfectedAIEngine()
AAIEngine()
end

if GameLast < GetGameTime() then
if Win == "timeout" then
DoWin()
else
DoLost()
end
end

end

coroutine.yield()

end
end

function DoLost()

Pause()
MessageBox(LostMessage)
WaitDialog()
Unpause()
Quit(false)

end

function DoWin()

Pause()
MessageBox(LostMessage)
WaitDialog()
Unpause()
MissionsDone = MissionsDone + 1
SaveGameStats()
Quit(true)

end



































function AIinit()
-- *** INFECTED AI V2.3 : INIT ***
-- *** AUTHOR: ANNIKK.EXE ***
-- *** EMAIL: annikk [dot] exe [at] gmail [dot] com ***

Globals.AI.GraceTimer=(99999)

-- Number of times the engine is run per While loop:
numberofiterations = 0
-- Set to 0 for very large maps. (50 asteroids+)
-- Set to 2-4 for small maps for quicker AI response.

metric = {}
currentowner = {}

for i = 0,300 do
metric[i] = 500
end


-- *** END INFECTED AI : INIT ***
end


function InfectedAIEngine()
-- *** INFECTED AI V2.3 : ENGINE ***
-- Author: ANNIKK.EXE [at] GMAIL [dot] COM
numberofasteroids = -1
neighbours = {}

for i = 0, 300 do
if GetAsteroid(i) ~= nil then
if GetAsteroid(i).radius > 10 then
numberofasteroids = numberofasteroids + 1
end
end
end

-- now the variable called "numberofasteroids" accurately represents the number of playable asteroids on the field.

for iterations = 0,numberofiterations do

-- Select an asteroid for checking.
checkedroid = GetAsteroid(math.random(0,numberofasteroids))

-- Record the current asteroid owner
changedowner = false

if currentowner[checkedroid.id] ~= nil then
if currentowner[checkedroid.id] ~= checkedroid.owner then
currentowner[checkedroid.id] = checkedroid.owner
changedowner = true
end
else
currentowner[checkedroid.id] = checkedroid.owner
end

tree = nil
flower = nil

-- flower check !
tree = checkedroid:GetRandomDysonTree()

if tree ~= nil then
flower = tree:GetSuperSeedling()
end

if checkedroid.owner > 1 and flower ~= nil then
flower:Pluck()
end

flower = checkedroid:GetFlower(checkedroid.owner)

if checkedroid.owner > 1 and flower ~= nil then
flower:PlantOnRandomDysonTree()
end

-- calculate which asteroids are a neighbour to checkedroid
numberofneighbours = -1

for i = 0,numberofasteroids do

length = GetAsteroid(i).position.x - checkedroid.position.x
height = GetAsteroid(i).position.y - checkedroid.position.y

distancetoroid = math.sqrt((length * length) + (height * height))
distancetoroid = distancetoroid - GetAsteroid(i).Radius

if distancetoroid < checkedroid.SendDistance then
-- this asteroid is in range.  Add it to the neighbours list, and increment the neighbour count by one.  ALSO ADDS SELF AS NEIGHBOUR!  But we trap for this in the Metric Update section.
numberofneighbours = numberofneighbours + 1
neighbours[numberofneighbours] = GetAsteroid(i)
end
end

-- Metric update
-- did we update from our own status?
updated = false

-- are we under attack?  if so set metric 0
if checkedroid.owner ~= 1 and checkedroid.owner ~= 0 then

if (checkedroid:GetNumSeedlings() - checkedroid:GetNumSeedlings(checkedroid.owner)) > (checkedroid:GetNumTrees() * 5) or checkedroid:GetNumMines(1) > 0 then

-- ok well we own this asteroid, and there are more enemy seeds here than our seeds (or there's a player mine here).  Now, we DO have at least 1 tree worth defending here, right?
if checkedroid:GetNumTrees() > 0 then
-- ok, we're under attack!  METRIC 0!
metric[checkedroid.ID] = 0
updated = true

end
end
end

-- are we maxed on trees?  if not, set metric 100
-- (make sure we don't run this if we are under attack!)
if updated == false then

if checkedroid:GetNumTrees() < checkedroid.TreeCap then
-- we don't have max trees here yet.  Metric 100!
metric[checkedroid.ID] = 100
updated = true
end

end
-- Not under attack, maxed on trees, and ready to contribute to the empire.
-- Check the status of our neighbours first before trying to become a gather point.
-- only run this part of the code if we didn't get our metric from our own status
if updated == false then
-- are we a suitable gather point?

enemydetected = false
frienddetected = false
gatherpointdetected = false
lowermetricsnearby = false

for i = 0, numberofneighbours do

-- check that we're not examining ourself.
if neighbours[i] ~= checkedroid then

if neighbours[i].owner == checkedroid.owner then
-- this asteroid is friendly to us
frienddetected = true
end

if neighbours[i].owner ~= checkedroid.owner and neighbours[i].owner ~= 0 and neighbours[i]:GetNumTrees() > 0 then
-- this asteroid doesn't belong to us or player 0, and has at least 1 tree.  It must be an enemy roid.
enemydetected = true
end

numberofenemies = neighbours[i]:GetNumSeedlings() - neighbours[i]:GetNumSeedlings(checkedroid.owner)

if neighbours[i].owner ~= checkedroid.owner and neighbours[i]:GetNumTrees() == 0 and numberofenemies > 0 then
-- this asteroid doesn't belong to us, has no trees on it, but has enemy seedlings on it.  Treat it as enemy.
enemydetected = true
end

if neighbours[i].owner == checkedroid.owner and metric[neighbours[i].ID] == 200 then
-- this asteroid is friendly to us, and is a gather point.
gatherpointdetected = true
end

if neighbours[i].owner == checkedroid.owner and metric[neighbours[i].id] < 200 then
-- uh-oh, there's an asteroid nearby with a metric lower than 200.  There are Lower Metrics Nearby!
lowermetricsnearby = true
end
if neighbours[i].owner == 0 and metric[neighbours[i].id] < 200 then
-- uh-oh, there's an asteroid nearby with a metric lower than 200.  There are Lower Metrics Nearby!
lowermetricsnearby = true
end
end

end

if enemydetected == true and frienddetected == true and gatherpointdetected == false and lowermetricsnearby == false then
-- the conditions are right for me to become a gather point.
metric[checkedroid.id] = 200
elseif changedowner == true then
-- the asteroid just became mine.  insta-gather point please!
metric[checkedroid.id] = 200
end

-- Find the lowest metric among my neighbours
lowestmetric = metric[checkedroid.ID]

for i = 0, numberofneighbours do

-- check that we're not examining ourself.
if neighbours[i].id ~= checkedroid.id then

if neighbours[i].owner == checkedroid.owner or neighbours[i].owner == 0 then
-- this asteroid belongs to our empire, or it doesn't belong to anyone (and we should therefore follow its metrics)

-- is this neighbour's metric less than mine?  (also, have we just taken this asteroid..?)
if metric[neighbours[i].ID] < lowestmetric and changedowner == false then
-- yes it's lower.
lowestmetric = metric[neighbours[i].ID]
end

end

end
end

-- now we've established what the lowest metric is.  If it's lower than ours, set ours to that +1.  If the lowest metric of a neighbour is the same as our metric, increase ours by 1.
-- UNLESS we are a gather point
if metric[checkedroid.ID] > lowestmetric and metric[checkedroid.ID] ~= 200 and metric[checkedroid.ID] ~= 100 then
metric[checkedroid.ID] = lowestmetric + 5
end

if metric[checkedroid.ID] == lowestmetric and metric[checkedroid.ID] ~= 200 and metric[checkedroid.ID] ~= 100 then
-- if my metric is the same as the lowest metric of my neighbours, i must be 1 step further away than they are.
metric[checkedroid.ID] = metric[checkedroid.ID] + 5
end

-- check for errors, reset metric if necessary

if metric[checkedroid.id] > 500 then
metric[checkedroid.id] = 200
end

if metric[checkedroid.ID] > 0 and metric[checkedroid.ID] < 99 then
stillinneed = false

for i = 0,numberofasteroids do
if GetAsteroid(i).Owner == checkedroid.Owner and metric[i] == 0 then
stillinneed = true
end
end

if stillinneed == false then
for i = 0,numberofasteroids do
if GetAsteroid(i).owner == checkedroid.owner and metric[i] > 0 and metric[i] < 99 then
metric[i] = 500
end
end
end

end

if metric[checkedroid.ID] > 100 and metric[checkedroid.ID] < 199 then
stillinneed = false
for i = 0,numberofasteroids do
if GetAsteroid(i).Owner == checkedroid.Owner or GetAsteroid(i).owner == 0 then
if metric[i] == 100 then
stillinneed = true
end
end
end

if stillinneed == false then
for i = 0,numberofasteroids do
if GetAsteroid(i).owner == checkedroid.owner and metric[i] > 100 and metric[i] < 199 then
metric[i] = 500
end
end
end
end

if metric[checkedroid.ID] > 200 and metric[checkedroid.ID] < 299 then
stillinneed = false
for i = 0,numberofasteroids do
if GetAsteroid(i).Owner == checkedroid.Owner and metric[i] == 200 then
stillinneed = true
end
end

if stillinneed == false then
for i = 0,numberofasteroids do
if GetAsteroid(i).owner == checkedroid.owner and metric[i] > 200 and metric[i] < 299 then
metric[i] = 500
end
end
end
end

end

-- Now to check that if we have metric 0, 100 or 200, we still require that status.

if metric[checkedroid.id] == 0 then
-- ok.  Am I REALLY still under attack?
if checkedroid:GetNumSeedlings() - checkedroid:GetNumSeedlings(checkedroid.owner) > 1 or checkedroid:GetNumMines(1) > 0 then
-- the enemy outnumber us, or there's a player mine here.  Yes, we're really under attack...
else
-- we're not really under attack anymore.  lets reset the metric.
for i = 0, numberofasteroids do
if GetAsteroid(i).owner == checkedroid.owner then
metric[i] = 500
end

end
metric[checkedroid.id] = 200
end
end

if metric[checkedroid.id] == 100 then
-- ok.  Am I REALLY still under construction?
if checkedroid:GetNumTrees() < checkedroid.TreeCap then
-- we do indeed have less trees than the treecap, so we still need seeds.
else
-- we're not really under construction anymore.  lets reset the metric.
metric[checkedroid.id] = 200
end
end

enemydetected = false
frienddetected = false
gatherpointdetected = false
lowermetricsnearby = false

-- ok.  Am I REALLY still a suitable gather point?
for i = 0, numberofneighbours do
-- check that we're not examining ourself.
if metric[checkedroid.ID] == 200 and neighbours[i].ID ~= checkedroid.id and changedowner == false then
if neighbours[i].owner == checkedroid.owner or neighbours[i].owner == 0 then
-- this asteroid is friendly or neutral to us
frienddetected = true
end

if neighbours[i].owner ~= checkedroid.owner and neighbours[i].owner ~= 0 and neighbours[i]:GetNumTrees() > 0 then
-- this asteroid doesn't belong to us or player 0, and has at least 1 tree.  It must be an enemy roid.
enemydetected = true
end

numberofenemies = neighbours[i]:GetNumSeedlings() - neighbours[i]:GetNumSeedlings(checkedroid.owner)

if neighbours[i].owner ~= checkedroid.owner and neighbours[i]:GetNumTrees() == 0 and numberofenemies > 9 then
-- this asteroid doesn't belong to us, has no trees on it, but has enemy seedlings on it.  Treat it as enemy.
enemydetected = true
end

if neighbours[i].owner == checkedroid.owner and metric[neighbours[i].ID] == 200 then
-- this asteroid is friendly to us, and is a gather point.
gatherpointdetected = true
end

if neighbours[i].owner == checkedroid.owner and metric[neighbours[i].id] < 200 then
-- uh-oh, there's an asteroid nearby with a metric lower than 200.  There are Lower Metrics Nearby!
lowermetricsnearby = true
end
if neighbours[i].owner == 0 and metric[neighbours[i].id] < 200 then
-- uh-oh, there's an asteroid nearby with a metric lower than 200.  There are Lower Metrics Nearby!
lowermetricsnearby = true
end
end

end

if metric[checkedroid.id] == 200 and changedowner == false then

if enemydetected == true and gatherpointdetected == false and lowermetricsnearby == false then
-- the conditions are right for me to continue as a gather point.

else
-- the conditions are no longer right.  Best to reset the metric.
metric[checkedroid.id] = 500
end

end

if frienddetected == false and enemydetected == true and checkedroid:GetNumTrees() == checkedroid.TreeCap then
-- we're an orphan with max trees!  lets become a gather point.
metric[checkedroid.id] = 200
end

-- Actions

-- There are 3 different action types.  We must make sure not to use any actions for players 0 and 1!
-- 1.  Plant trees

-- trap for player 0, exclude player 1
if checkedroid.owner == 0 or checkedroid.owner > 1 then
-- so plant one :>
for i = 2,10 do

if metric[checkedroid.id] == 100 and (checkedroid:GetNumSeedlings() - checkedroid:GetNumSeedlings(i)) < 5 and checkedroid:GetNumSeedlings(i) > 9 then
-- this asteroid isn't owned by greys or player, the enemy only has a bit of seedlings here
-- its metric is 100
-- and it has enough seedlings belonging to the asteroid's empire to plant a tree
a = checkedroid:PlantDysonTree(i)
end
end
end

-- 2.  Send seedlings to the next lowest metric

if metric[checkedroid.id] ~= 0 and metric[checkedroid.id] ~= 100 and metric[checkedroid.id] ~= 500 and checkedroid.owner > 1 then

-- we're not under attack or construction.
numberofdestinations = 0

for i = 0,numberofneighbours do
if neighbours[i].owner == checkedroid.owner or neighbours[i].owner == 0 then
-- this neighbour is one of our asteroids, or it's a blank asteroid

if neighbours[i].owner == checkedroid.owner or neighbours[i].owner == 0 then
if metric[neighbours[i].ID] < metric[checkedroid.ID] then
-- we've found a friendly neighbour with a metric lower than ours!
-- add it to the destinations list
numberofdestinations = numberofdestinations + 1
end
end

end
end

if numberofdestinations > 0 then

-- we've found some destinations to send seeds to.  Lets send some.
numberofseedsleft = checkedroid:GetNumSeedlings(checkedroid.owner) - (checkedroid:GetNumSeedlings() - checkedroid:GetNumSeedlings(checkedroid.owner))
numberperdestination = numberofseedsleft / numberofdestinations

for i = 0,numberofneighbours do
if neighbours[i] ~= checkedroid then
if neighbours[i].owner == checkedroid.owner or neighbours[i].owner == 0 then
if metric[neighbours[i].ID] < metric[checkedroid.ID] then
-- this destination has less than our metric.  This is one of the valid destinations.  Send a proportional amount of seeds to it.
if neighbours[i].owner == 0 and numberofseedsleft < 10 then
-- don't bother sending.

elseif neighbours[i].owner == 0 and neighbours[i]:GetNumSeedlings() - neighbours[i]:GetNumSeedlings(checkedroid.owner) > 0 and numberofseedsleft > 9 + (neighbours[i]:GetNumSeedlings() - neighbours[i]:GetNumSeedlings(checkedroid.owner)) then
-- attack the greys!  (or whoever is camping the roid!)
checkedroid:SendSeedlingsToTarget(checkedroid.owner, checkedroid:GetNumSeedlings(checkedroid.owner), neighbours[i])
numberofseedsleft = 0

elseif neighbours[i].owner == 0 and numberofseedsleft > 9 and (neighbours[i]:GetNumSeedlings() - neighbours[i]:GetNumSeedlings(checkedroid.owner)) == 0 then
-- this is the last we can manage.  Send all 10.
checkedroid:SendSeedlingsToTarget(checkedroid.owner, 10, neighbours[i])
numberofseedsleft = numberofseedsleft - 10

elseif neighbours[i].owner == checkedroid.owner then
checkedroid:SendSeedlingsToTarget(checkedroid.owner, numberperdestination, neighbours[i])
numberofseedsleft = numberofseedsleft - numberperdestination
end
end
end
end
end
end

-- 3.  Attack the weakest nearby asteroid

-- Are we a gather point?  Only gather points are allowed to attack.

if metric[checkedroid.id] == 200 then

totalenemies = 0
totalfriendlies = checkedroid:GetNumSeedlings(checkedroid.owner)
weakestamount = 10000
weakestroid = checkedroid
attack = false
orphan = true
numberofenemyroids = 0

for i = 0,numberofneighbours do

if neighbours[i].owner == checkedroid.owner and neighbours[i] ~= checkedroid then
orphan = false
end

if neighbours[i].owner ~= checkedroid.owner and neighbours[i]:GetNumSeedlings() - neighbours[i]:GetNumSeedlings(checkedroid.owner) > 5 then
-- found an attack path
numberofenemyroids = numberofenemyroids + 1
end

for j = 0,10 do
if checkedroid.owner ~= j then
totalenemies = totalenemies + neighbours[i]:GetNumSeedlings(j)

if weakestamount > neighbours[i]:GetNumSeedlings(j) and neighbours[i].owner == j then
-- the owner of this asteroid has a smaller number of seeds than we've seen before...
weakestamount = neighbours[i]:GetNumSeedlings(j)
weakestroid = neighbours[i]
end

end
end

if neighbours[i] ~= checkedroid and neighbours[i].owner ~= checkedroid.owner then
if neighbours[i]:GetNumSeedlings(checkedroid.owner) > (neighbours[i]:GetNumSeedlings() - neighbours[i]:GetNumSeedlings(checkedroid.owner)) then
-- already attacking, and winning.  send reinforcements.
checkedroid:SendSeedlingsToTarget(checkedroid.owner, checkedroid:GetNumSeedlings(checkedroid.owner), neighbours[i])
end
end
end

-- in the first case, we have more seedlings than all the neighbouring asteroids put together.
if totalfriendlies > totalenemies + (weakestroid:GetNumTrees() * 10) then
attack = true
end

split = false

-- in the second case, we have more than 150 seedlings on this roid, and it's time to move out!
if totalfriendlies > 150 then
attack = true
split = true
end

if totalfriendlies >= Globals.Asteroids.SpawnCap and orphan == true then
attack = true
end

if attack == true and checkedroid.owner > 1 and split == false then
-- ok so we're a gather point, we're ready to attack, and we aren't a player or greys asteroid.
-- lets move out.
checkedroid:SendSeedlingsToTarget(checkedroid.owner, totalfriendlies, weakestroid)
elseif attack == true and checkedroid.owner > 1 and split == true then

for i = 0,numberofneighbours do
if neighbours[i].owner ~= checkedroid.owner then
-- attackable path - send proportional amount of seeds.
checkedroid:SendSeedlingsToTarget(checkedroid.owner, totalfriendlies / numberofenemyroids, neighbours[i])
end
end
end
end
end
-- Set asteroid names to whatever their metric is.  Uncomment the
-- line below for testing purposes if the AI shows unexpected behaviours.
-- checkedroid.Name = metric[checkedroid.ID]
end
-- *** END INFECTED AI : ENGINE ***
end

function AAIInit(empire)

Empire = empire --Which AI empire should the AI control?

Globals.AI.GraceTimer = 9999999
AAINumRoids = -1
AAISelectedRoid = 0
AAIPriority = {}
AAINo_Priority = false
AAILastCheckedOwner = {}
AAITakeBack = {}
AAITakeBackTimer = {}
AAIHaveRoots = {}

for i = 0,100000 do
if GetAsteroid(i) ~= nil then

AAINumRoids = AAINumRoids + 1
AAIPriority[i] = 0
AAITakeBack[i] = false
AAILastCheckedOwner[i] = GetAsteroid(i).Owner
AAIHaveRoots[i] = false

else

break

end

end

end

function AAIEngine()

local HighestEnergy = 0
local HighestStr = 0
local HighestSpeed = 0

for i = 0,AAINumRoids do
if GetAsteroid(i).owner ~= Empire then
GetAsteroid(i):SetGraceTime(0)
else
GetAsteroid(i):SetGraceTime(99999)
if GetAsteroid(i).attribs.energy > HighestEnergy then

HighestEnergy = GetAsteroid(i).attribs.energy

end

if GetAsteroid(i).attribs.strength > HighestStr then

HighestStr = GetAsteroid(i).attribs.strength

end

if GetAsteroid(i).attribs.speed > HighestSpeed then

HighestSpeed = GetAsteroid(i).attribs.speed

end
if AAIHaveRoots[i] == false and GetAsteroid(i):GetNumTrees() > 0 then

AAIHaveRoots[i] = true

end
end
end

AAISelectedRoid = math.random(0,AAINumRoids)
local Numneighbours = 0
local Neighbour = {}

local ChangedOwner = false

if GetAsteroid(AAISelectedRoid).Owner ~= AAILastCheckedOwner[AAISelectedRoid] then

ChangedOwner = true

end

if ChangedOwner == true and AAILastCheckedOwner[AAISelectedRoid] == Empire then

AAITakeBack[AAISelectedRoid] = true
AAITakeBackTimer[AAISelectedRoid] = GetGameTime() + 30

end

if ChangedOwner == true and AAITakeBack[AAISelectedRoid] == true and AAILastCheckedOwner[AAISelectedRoid] ~= Empire and GetAsteroid(AAISelectedRoid).Owner == Empire then

AAITakeBack[AAISelectedRoid] = false
AAITakeBackTimer[AAISelectedRoid] = nil

end

if AAITakeBackTimer[AAISelectedRoid] ~= nil then
if GetGameTime() > AAITakeBackTimer[AAISelectedRoid] then
AAITakeBack[AAISelectedRoid] = false
AAITakeBackTimer[AAISelectedRoid] = nil
end
end

--Flowertime :D No seriously -.-

local Tree = GetAsteroid(AAISelectedRoid):GetRandomDysonTree()

if Tree ~= nil then

Flower = Tree:GetSuperSeedling()

end

if Flower ~= nil and GetAsteroid(AAISelectedRoid).Owner == Empire then

Flower:Pluck()

end

local Flower = GetAsteroid(AAISelectedRoid):GetFlower(Empire)

if Flower ~= nil and GetAsteroid(AAISelectedRoid).Owner == Empire then

Flower:PlantOnRandomDysonTree()

end

--Now as we have the selectedroid here, begin making conditions for priorities to be set...
--First if the ERRoid is attacked, what do we do? We set the priority to zero, so the neighbours know that: "OMGosh, that ERRoid is attacked, help it!"
if GetAsteroid(AAISelectedRoid):GetNumSeedlingsExcluding(Empire) > GetAsteroid(AAISelectedRoid):GetNumSeedlings(Empire)/4 and GetAsteroid(AAISelectedRoid).Owner == Empire and AAIPriority[AAISelectedRoid] > 0 then

AAIPriority[AAISelectedRoid] = 0

elseif AAITakeBack[AAISelectedRoid] == true and AAIPriority[AAISelectedRoid] ~= 0 then

AAIPriority[AAISelectedRoid] = 0

end

if GetAsteroid(AAISelectedRoid):GetMine(1) ~= nil then

AAIPriority[AAISelectedRoid] = 0

end

if GetAsteroid(AAISelectedRoid):GetNumTrees() < GetAsteroid(AAISelectedRoid).TreeCap and GetAsteroid(AAISelectedRoid):GetNumTrees() >= 1 and GetAsteroid(AAISelectedRoid).Owner == Empire and AAIPriority[AAISelectedRoid] > AAINumRoids*2 then

AAIPriority[AAISelectedRoid] = AAINumRoids*2

end

if GetAsteroid(AAISelectedRoid):IsVisible(Empire) ~= true and AAIPriority[AAISelectedRoid] > AAINumRoids*4 then

AAIPriority[AAISelectedRoid] = AAINumRoids*4

end

if GetAsteroid(AAISelectedRoid):GetNumTrees() == 0 and AAIHaveRoots[AAISelectedRoid] == false and AAIPriority[AAISelectedRoid] > AAINumRoids*6 then

AAIPriority[AAISelectedRoid] = AAINumRoids*6

end

if GetAsteroid(AAISelectedRoid).Owner ~= Empire and GetAsteroid(AAISelectedRoid):IsVisible(Empire) == true and GetEmpire(Empire).NumSeedlings > GetAsteroid(AAISelectedRoid):GetNumSeedlingsExcluding(Empire)*1.5 and AAIPriority[AAISelectedRoid] > AAINumRoids*8 then

AAIPriority[AAISelectedRoid] = AAINumRoids*8

end

--Now check if all of the priorities are still correct, so we can decide if we want it to refresh or not...

--Are we still attacked?
if AAIPriority[AAISelectedRoid] == 0 and GetAsteroid(AAISelectedRoid):GetNumSeedlingsExcluding(Empire) == 0 and GetAsteroid(AAISelectedRoid).Owner == Empire and AAITakeBack[AAISelectedRoid] == false and GetAsteroid(AAISelectedRoid):GetMine(1) == nil then

AAIPriority[AAISelectedRoid] = AAINumRoids*10

elseif AAIPriority[AAISelectedRoid] == 0 and GetAsteroid(AAISelectedRoid).Owner ~= Empire and AAIPriority[AAISelectedRoid] == 0 and AAITakeBack[AAISelectedRoid] == false then

AAIPriority[AAISelectedRoid] = AAINumRoids*10

end

if AAIPriority[AAISelectedRoid] == AAINumRoids*2 and GetAsteroid(AAISelectedRoid):GetNumTrees() == GetAsteroid(AAISelectedRoid).TreeCap and GetAsteroid(AAISelectedRoid).Owner == Empire then

AAIPriority[AAISelectedRoid] = AAINumRoids*10

end

if AAIPriority[AAISelectedRoid] == AAINumRoids*4 and GetAsteroid(AAISelectedRoid):IsVisible(Empire) == true then

AAIPriority[AAISelectedRoid] = AAINumRoids*10

end

if AAIPriority[AAISelectedRoid] == AAINumRoids*6 and GetAsteroid(AAISelectedRoid):GetNumTrees() > 0 then

AAIPriority[AAISelectedRoid] = AAINumRoids*10

end

if GetAsteroid(AAISelectedRoid).Owner == Empire and AAIPriority[AAISelectedRoid] == AAINumRoids*8 then

AAIPriority[AAISelectedRoid] = AAINumRoids*10

end

if AAIPriority[AAISelectedRoid] == AAINumRoids*2 and GetAsteroid(AAISelectedRoid):GetNumSeedlings(Empire) >= 10 and GetAsteroid(AAISelectedRoid).Owner == Empire then

GetAsteroid(AAISelectedRoid):PlantDysonTree(Empire)

end

if AAIPriority[AAISelectedRoid] == AAINumRoids*6 and GetAsteroid(AAISelectedRoid):GetNumSeedlings(Empire) >= 10 then

local Lowerstats = 0
if GetAsteroid(AAISelectedRoid).attribs.energy < HighestEnergy/2 then

Lowerstats = Lowerstats+1

end

if GetAsteroid(AAISelectedRoid).attribs.strength < HighestStr/2 then

Lowerstats = Lowerstats+1

end

if GetAsteroid(AAISelectedRoid).attribs.speed < HighestSpeed/2 then

Lowerstats = Lowerstats+1

end

if Lowerstats >= 2 then

GetAsteroid(AAISelectedRoid):PlantDefenseTree(Empire)

else

GetAsteroid(AAISelectedRoid):PlantDysonTree(Empire)

end

end

local Yes_Priority = false
AAINo_Priority = false
local LowestPriority = AAINumRoids*10

--Scanning for every empire, so everyone can see the status for the ERRoid...
for i = 0,AAINumRoids do

if AAIPriority[i] < LowestPriority then

LowestPriority = AAIPriority[i]

end

if i ~= AAISelectedRoid then

--Figuring the distance between the two roids...
Xdif = GetAsteroid(AAISelectedRoid).position.X - GetAsteroid(i).position.X
Ydif = GetAsteroid(AAISelectedRoid).position.Y - GetAsteroid(i).position.Y
Dist = math.abs(math.sqrt((Xdif*Xdif)+(Ydif*Ydif)))

if Dist <= GetAsteroid(AAISelectedRoid).SendDistance+GetAsteroid(i).Radius then
--Ok, we have a neighbour, add it to the list so we can check it for several stuff later!
Numneighbours = Numneighbours+1
Neighbour[Numneighbours] = GetAsteroid(i)
end

end
end

for i = 1,Numneighbours do


if AAIPriority[AAISelectedRoid] > AAIPriority[Neighbour[i].ID] and GetAsteroid(AAISelectedRoid).Owner == Empire then

AAIPriority[AAISelectedRoid] = AAIPriority[Neighbour[i].ID]+1
if AAIPriority[Neighbour[i].ID] == AAINumRoids*8 and GetAsteroid(AAISelectedRoid):GetNumSeedlings(Empire)/1.5 > Neighbour[i]:GetNumSeedlings(Neighbour[i].Owner) then
GetAsteroid(AAISelectedRoid):SendSeedlingsToTarget(Empire, GetAsteroid(AAISelectedRoid):GetNumSeedlings(Empire), GetAsteroid(Neighbour[i].ID))
elseif AAIPriority[Neighbour[i].ID] == 0 and GetAsteroid(AAISelectedRoid):GetNumSeedlings(Empire)/1.5 > Neighbour[i]:GetNumSeedlings(Neighbour[i].Owner) then
GetAsteroid(AAISelectedRoid):SendSeedlingsToTarget(Empire, GetAsteroid(AAISelectedRoid):GetNumSeedlings(Empire), GetAsteroid(Neighbour[i].ID))
elseif AAIPriority[Neighbour[i].ID] ~= AAINumRoids*8 then
GetAsteroid(AAISelectedRoid):SendSeedlingsToTarget(Empire, GetAsteroid(AAISelectedRoid):GetNumSeedlings(Empire), GetAsteroid(Neighbour[i].ID))
end
Yes_Priority = true

elseif AAIPriority[AAISelectedRoid]~=0 and AAIPriority[AAISelectedRoid]~=AAINumRoids*2 and AAIPriority[AAISelectedRoid]~=AAINumRoids*4 and AAIPriority[AAISelectedRoid]~=AAINumRoids*6 and AAIPriority[AAISelectedRoid]~=AAINumRoids*8 and AAIPriority[AAISelectedRoid]~=AAINumRoids*10 then

AAINo_Priority = true

end
end

if Yes_Priority == true and AAINo_Priority == true then

AAINo_Priority = false

end

if AAINo_Priority == true and GetAsteroid(AAISelectedRoid).Owner == Empire then

AAIPriority[AAISelectedRoid] = AAINumRoids*10

end

for sum = 1,5 do
if LowestPriority < AAINumRoids*(sum*2) and LowestPriority > AAINumRoids*((sum*2)-2) and LowestPriority ~= AAINumRoids*(sum*2) then

for i = 0,AAINumRoids do

if AAIPriority[AAISelectedRoid] > AAINumRoids*((sum*2)-2) and AAIPriority[AAISelectedRoid] < AAINumRoids*(sum*2) then

AAIPriority[AAISelectedRoid] = AAINumRoids*10

end
end
end
end

AAILastCheckedOwner[AAISelectedRoid] = GetAsteroid(AAISelectedRoid).Owner

--GetAsteroid(AAISelectedRoid).Name = AAIPriority[AAISelectedRoid]

end

I guess the code will get around 4k lines or more :o

And please don't boother other errors like some stuff missing, I was in the middle of the coding... Gonna fix that :)
Title: Re: What are you working on? :D
Post by: Aino on June 19, 2011, 12:41:22 AM
I'm soon going to create the loading of levels for my map, so you can create you own :)

Though, you'll need to learn a few stuff, cause it doesn't come out simple!


Or maybe not... unless someone know how to execute a lua styled file from a lua file... Cause it would be hard to have all the flexability without that :/

EDIT: Atlewast I'll need a day of planning, better start now :D

EDIT2:

I guess a mapfile might look a little like this:

Code: [Select]
Open
"hello, boys, calm down!"
Lost
"do nothing no!"
Win
"lol!"
WinType
"conquest"
AI
"infected"

createroid
random
-1000
1000
random
5000
6000

createroidatt
random
-1000
1000
random
5000
6000
0.8
0.3
0.5

createfield
0
0
5
common
x
random
-10000
10000
y
random
-10000
10000
end

EDIT 3:

My guide:

Code: [Select]
First off, make sure the whole thing is installed correctly!!!

Then you can open the example.map file, which has no content strangely...

Then you can start of by writing something like:

Open
"x"

x is your choice of text, since you make a map, you shouldn't be limited by writing anything...

Just remember: as you write texts, lua "laws" still holds, like a new line is \n and not pressing enter!

An actual new line in the file means that you are going to indicate something new... this means that you cannot do

Open
"I went to the
forest to meet my friends"

because it returns illegal.

To explain this much more I'll explain it the next few lines:

The maploader, does only recognize one line at the time, so it you state Open(short for OpeningText, which is what will appear in the messagebox at start...) the computer will automatically make the next line the OpeningText.
Now if you split it in two lines directly(meaning not with \n) you get the error, because after the line below Open, the computer either expect emptyness or a command...

Now that we know that, let's explore the boundaries of what you can do:


Open
We know that Open is the OpeningTEXT


Win
This is WinTEXT, or the text for the messagebox that appears when you've won!


Lost
This is the LoseTEXT, same deal as win, only difference is that it appears when you lose.


WinType
WinType is how to win, examples are:

"conquest" which is to capture all asteroids

"timeout" waiting some time, this is good for survival maps!

"lose" to make things clear on this one, you need to lose all asteroids to win this map.


AI
This is the AI that runs in the game, you can use both "infected" and "alien".


Time (measured in seconds!)
If the win condition is "timeout" then you must set the time, after this time period, the game ends depending on winningconditions...


Note: When text is quoted, that's how it should appear on the document.


When creating the map you can use:

Note: x and y are co-ordinates!


createroid
x
y


createroidatt
x
y
energy
strength
speed


createfield
x
y
number of roids
common(is written common in the document too, common states what is common with the asteroid in the field!)
x
y


change(change is capable of changing every property of the asteroid as yo can think of...)


Example of uses in "change":

NOTE: Value without anything telling what it is, is a number!


treecap
needs one value


owner
needs one value


numseeds
needs one value


numsuperseeds
needs one value


addtree
needs one text value and one value


moving
needs a boolean value (booleans are true/false!!!!!)


Now as you've seen the commands, let's look at the math!

random
Needs two values, like this:

random
600
1200

random acts as random in Lua, meaning that is only runs whole numbers!


cos
Needs one value!


sin
Needs one value


pi
needs no value, can be used in others!


currentinfield
Calls the current roid in the field(NOT THE ID OF THE ASTEROID!!!)


To the arithmetics, even though you might think it is a simple deal like 1-1, it is not:

for doing a simple calculation like 1-1 you must do

minus
1


useable in arithmetics:

plus (adding)

minus (subtract)

divide (dividing)

times (multiplying)

exponent (multiply by self!)

But, this limits the player pretty much :/

How do you make in-game events???

EDIT 3:

Figured alot of stuff out, for example how to make custom values and then importing it :D

You'll do math at the custom values, nothing else though... But does that matter?
Title: Re: What are you working on? :D
Post by: Aino on June 19, 2011, 05:31:55 AM
Wooo!

I'm up to 2k lines already...

But now I am fixing the last of what is needed though, the map loader, which is fairly huge o.O
Title: Re: What are you working on? :D
Post by: Aino on June 19, 2011, 06:19:04 AM
Now as I am fully done(hopelyfully D:) I need to get one thing fixed, and it is not about the return, it is the MissionsDone var that is unstable x.x

EDIT: I did it!

It's so retarded that I needed to do it to a numbe... DEEERP... r, I needed to add a... Derp?... tonumber() function to convert it from a... derp -.-... string to number :/

This has been troubling me for aslong as I've been doing this code(apr. one day o.O)

Now I need maps, alot of em' guys/girls!

I'll make a guide soon, just gotta test if all the functions work properly :)

EDIT 2:

Arghhh, need help with the loadmap function, it won't work :/

Code: [Select]
function LoadMap(ID)

if io.open(BasicSaveFolder .. "\\Adventure\\Maps\\" .. MapNames[ID] .. ".map", "r") then

assert(io.input(io.open(BasicSaveFolder .. "\\Adventure\\Maps\\" .. MapNames[ID] .. ".map", "r")))

local activation = nil
local activationlast = 0
local gettingvalue = false
local customvalue = {}
local latestid = nil

for line in io.lines() do

if activation ~= nil then
if activation == "Open" then
OpeningText = line
activationlast = activationlast - 1
if activationlast == 0 then
activation = nil
end
elseif activation == "Win" then
WinMessage = line
activationlast = activationlast - 1
if activationlast == 0 then
activation = nil
end
elseif activation == "Lost" then
LostMessage = line
activationlast = activationlast - 1
if activationlast == 0 then
activation = nil
end
elseif activation == "WinType" then
Win = line
activationlast = activationlast - 1
if activationlast == 0 then
activation = nil
end
elseif activation == "AI" then
AIType = line
activationlast = activationlast - 1
if activationlast == 0 then
activation = nil
end
elseif activation == "Time" then
MapTime = tonumber(line)
activationlast = activationlast - 1
if activationlast == 0 then
activation = nil
end
elseif activation == "createroid" then
if activationlast == 2 then
if gettingvalue ~= true then
if line ~= "getvalue" then
local x = tonumber(line)
activationlast = activationlast - 1
else
gettingvalue = true
end
else
local x = customvalue[tonumber(line)]
gettingvalue = false
activationlast = activationlast - 1
end
elseif activationlast == 1 then
if gettingvalue ~= true then
if line ~= "getvalue" then
local y = tonumber(line)
activationlast = activationlast - 1
else
gettingvalue = true
end
else
local y = customvalue[tonumber(line)]
gettingvalue = false
activationlast = activationlast - 1
end
end
if activationlast == 0 then
AddAsteroid(x,y)
activation = nil
end
elseif activation == "createroidatt" then
if activationlast == 5 then
if gettingvalue ~= true then
if line ~= "getvalue" then
local x = tonumber(line)
activationlast = activationlast - 1
else
gettingvalue = true
end
else
local x = customvalue[tonumber(line)]
gettingvalue = false
activationlast = activationlast - 1
end
elseif activationlast == 4 then
if gettingvalue ~= true then
if line ~= "getvalue" then
local y = tonumber(line)
activationlast = activationlast - 1
else
gettingvalue = true
end
else
local y = customvalue[tonumber(line)]
gettingvalue = false
activationlast = activationlast - 1
end
elseif activationlast == 3 then
if gettingvalue ~= true then
if line ~= "getvalue" then
local e = tonumber(line)
activationlast = activationlast - 1
else
gettingvalue = true
end
else
local e = customvalue[tonumber(line)]
gettingvalue = false
activationlast = activationlast - 1
end
elseif activationlast == 2 then
if gettingvalue ~= true then
if line ~= "getvalue" then
local st = tonumber(line)
activationlast = activationlast - 1
else
gettingvalue = true
end
else
local st = customvalue[tonumber(line)]
gettingvalue = false
activationlast = activationlast - 1
end
elseif activationlast == 1 then
if gettingvalue ~= true then
if line ~= "getvalue" then
local sp = tonumber(line)
activationlast = activationlast - 1
else
gettingvalue = true
end
else
local sp = customvalue[tonumber(line)]
gettingvalue = false
activationlast = activationlast - 1
end
end
if activationlast == 0 then
AddAsteroidWithAttribs(x,y,e,st,sp)
activation = nil
end
elseif activation == "createroidatt" then
if activationlast == 4 then
if gettingvalue ~= true then
if line ~= "getvalue" then
local x = tonumber(line)
activationlast = activationlast - 1
else
gettingvalue = true
end
else
local x = customvalue[tonumber(line)]
gettingvalue = false
activationlast = activationlast - 1
end
elseif activationlast == 3 then
if gettingvalue ~= true then
if line ~= "getvalue" then
local y = tonumber(line)
activationlast = activationlast - 1
else
gettingvalue = true
end
else
local y = customvalue[tonumber(line)]
gettingvalue = false
activationlast = activationlast - 1
end
elseif activationlast == 2 then
if gettingvalue ~= true then
if line ~= "getvalue" then
local num = tonumber(line)
activationlast = activationlast - 1
else
gettingvalue = true
end
else
local num = customvalue[tonumber(line)]
gettingvalue = false
activationlast = activationlast - 1
end
elseif activationlast == 1 then
if gettingvalue ~= true then
if line ~= "getvalue" then
local size = tonumber(line)
activationlast = activationlast - 1
else
gettingvalue = true
end
else
local size = customvalue[tonumber(line)]
gettingvalue = false
activationlast = activationlast - 1
end
end
if activationlast == 0 then
for i = 1,num do
AddAsteroid(x+math.random(-size,size),y+math.random(-size,size))
end
activation = nil
end
elseif activation == "createvalue" then
if activationlast == 2 then
local id = tonumber(line)
elseif activationlast == 1 then
local val = tonumber(line)
end
activationlast = activationlast - 1
if activationlast == 0 then
customvalue[id] = val
latestid = id
activation = nil
end
elseif activation == "changeid" then
activationlast = activationlast - 1
if activationlast == 0 then
latestid = tonumber(line)
activation = nil
end
elseif activation == "createsfx" then
if activationlast == 17 then
if gettingvalue ~= true then
if line ~= "getvalue" then
local x = tonumber(line)
activationlast = activationlast - 1
else
gettingvalue = true
end
else
local x = customvalue[tonumber(line)]
gettingvalue = false
activationlast = activationlast - 1
end
elseif activationlast == 16 then
if gettingvalue ~= true then
if line ~= "getvalue" then
local y = tonumber(line)
activationlast = activationlast - 1
else
gettingvalue = true
end
else
local y = customvalue[tonumber(line)]
gettingvalue = false
activationlast = activationlast - 1
end
elseif activationlast == 15 then
if gettingvalue ~= true then
if line ~= "getvalue" then
local r = tonumber(line)
activationlast = activationlast - 1
else
gettingvalue = true
end
else
local r = customvalue[tonumber(line)]
gettingvalue = false
activationlast = activationlast - 1
end
elseif activationlast == 14 then
if gettingvalue ~= true then
if line ~= "getvalue" then
local g = tonumber(line)
activationlast = activationlast - 1
else
gettingvalue = true
end
else
local g = customvalue[tonumber(line)]
gettingvalue = false
activationlast = activationlast - 1
end
elseif activationlast == 13 then
if gettingvalue ~= true then
if line ~= "getvalue" then
local b = tonumber(line)
activationlast = activationlast - 1
else
gettingvalue = true
end
else
local b = customvalue[tonumber(line)]
gettingvalue = false
activationlast = activationlast - 1
end
elseif activationlast == 12 then
if gettingvalue ~= true then
if line ~= "getvalue" then
local a = tonumber(line)
activationlast = activationlast - 1
else
gettingvalue = true
end
else
local a = customvalue[tonumber(line)]
gettingvalue = false
activationlast = activationlast - 1
end
elseif activationlast == 11 then
if gettingvalue ~= true then
if line ~= "getvalue" then
local size = tonumber(line)
activationlast = activationlast - 1
else
gettingvalue = true
end
else
local size = customvalue[tonumber(line)]
gettingvalue = false
activationlast = activationlast - 1
end
elseif activationlast == 10 then
if gettingvalue ~= true then
if line ~= "getvalue" then
local rd = tonumber(line)
activationlast = activationlast - 1
else
gettingvalue = true
end
else
local rd = customvalue[tonumber(line)]
gettingvalue = false
activationlast = activationlast - 1
end
elseif activationlast == 9 then
if gettingvalue ~= true then
if line ~= "getvalue" then
local gd = tonumber(line)
activationlast = activationlast - 1
else
gettingvalue = true
end
else
local gd = customvalue[tonumber(line)]
gettingvalue = false
activationlast = activationlast - 1
end
elseif activationlast == 8 then
if gettingvalue ~= true then
if line ~= "getvalue" then
local bd = tonumber(line)
activationlast = activationlast - 1
else
gettingvalue = true
end
else
local bd = customvalue[tonumber(line)]
gettingvalue = false
activationlast = activationlast - 1
end
elseif activationlast == 7 then
if gettingvalue ~= true then
if line ~= "getvalue" then
local ad = tonumber(line)
activationlast = activationlast - 1
else
gettingvalue = true
end
else
local ad = customvalue[tonumber(line)]
gettingvalue = false
activationlast = activationlast - 1
end
elseif activationlast == 6 then
if gettingvalue ~= true then
if line ~= "getvalue" then
local sized = tonumber(line)
activationlast = activationlast - 1
else
gettingvalue = true
end
else
local sized = customvalue[tonumber(line)]
gettingvalue = false
activationlast = activationlast - 1
end
elseif activationlast == 5 then
if gettingvalue ~= true then
if line ~= "getvalue" then
local rcs = tonumber(line)
activationlast = activationlast - 1
else
gettingvalue = true
end
else
local rcs = customvalue[tonumber(line)]
gettingvalue = false
activationlast = activationlast - 1
end
elseif activationlast == 4 then
if gettingvalue ~= true then
if line ~= "getvalue" then
local gcs = tonumber(line)
activationlast = activationlast - 1
else
gettingvalue = true
end
else
local gcs = customvalue[tonumber(line)]
gettingvalue = false
activationlast = activationlast - 1
end
elseif activationlast == 3 then
if gettingvalue ~= true then
if line ~= "getvalue" then
local bcs = tonumber(line)
activationlast = activationlast - 1
else
gettingvalue = true
end
else
local bcs = customvalue[tonumber(line)]
gettingvalue = false
activationlast = activationlast - 1
end
elseif activationlast == 2 then
if gettingvalue ~= true then
if line ~= "getvalue" then
local acs = tonumber(line)
activationlast = activationlast - 1
else
gettingvalue = true
end
else
local acs = customvalue[tonumber(line)]
gettingvalue = false
activationlast = activationlast - 1
end
elseif activationlast == 1 then
if gettingvalue ~= true then
if line ~= "getvalue" then
local scs = tonumber(line)
activationlast = activationlast - 1
else
gettingvalue = true
end
else
local scs = customvalue[tonumber(line)]
gettingvalue = false
activationlast = activationlast - 1
end
end
if activationlast == 0 then
CreateSFX(x,y,r,g,b,a,size,rd,gd,bd,ad,sized,rcs,gcs,bcs,acs,scs)
activation = nil
end
elseif activation == "change" then
if activationlast == 3 then
if gettingvalue ~= true then
if line ~= "getvalue" then
local id = tonumber(line)
activationlast = activationlast - 1
else
gettingvalue = true
end
else
local id = customvalue[tonumber(line)]
gettingvalue = false
activationlast = activationlast - 1
end
elseif activationlast == 2 then
local what = tostring(line)
activationlast = activationlast - 1
elseif activationlast == 1 then
local changeto = line
activationlast = activationlast - 1
end
if activationlast == 0 then
if what == "owner" then
GetAsteroid(id).Owner = changeto
elseif what == "treecap" then
GetAsteroid(id).TreeCap = changeto
elseif what == "addseedlings" then
GetAsteroid(id):AddSeedlings(changeto)
elseif what == "addsuperseedlings" then
GetAsteroid(id):AddSuperSeedlings(changeto)
elseif what == "adddysontree" then
GetAsteroid(id):AddDysonTree()
elseif what == "adddefensetree" then
GetAsteroid(id):AddDefenseTree()
elseif what == "moving" then
GetAsteroid(id).Moveable = changeto

end
activation = nil
end
end
if subactivation == "add" then
if gettingvalue ~= true then
if line ~= "getvalue" then
local val = tonumber(line)
subactivationlast = subactivationlast - 1
else
gettingvalue = true
end
else
local val = customvalue[tonumber(line)]
gettingvalue = false
subactivationlast = subactivationlast - 1
end
subactivationlast = subactivationlast - 1
if subactivationlast == 0 then
customvalue[latestid] = customvalue[latestid] + val
subactivation = nil
end
elseif subactivation == "minus" then
if gettingvalue ~= true then
if line ~= "getvalue" then
local val = tonumber(line)
subactivationlast = subactivationlast - 1
else
gettingvalue = true
end
else
local val = customvalue[tonumber(line)]
gettingvalue = false
subactivationlast = subactivationlast - 1
end
subactivationlast = subactivationlast - 1
if subactivationlast == 0 then
customvalue[latestid] = customvalue[latestid] - val
subactivation = nil
end
elseif subactivation == "times" then
if gettingvalue ~= true then
if line ~= "getvalue" then
local val = tonumber(line)
subactivationlast = subactivationlast - 1
else
gettingvalue = true
end
else
local val = customvalue[tonumber(line)]
gettingvalue = false
subactivationlast = subactivationlast - 1
end
subactivationlast = subactivationlast - 1
if subactivationlast == 0 then
customvalue[latestid] = customvalue[latestid] * val
subactivation = nil
end
elseif subactivation == "divide" then
if gettingvalue ~= true then
if line ~= "getvalue" then
local val = tonumber(line)
subactivationlast = subactivationlast - 1
else
gettingvalue = true
end
else
local val = customvalue[tonumber(line)]
gettingvalue = false
subactivationlast = subactivationlast - 1
end
subactivationlast = subactivationlast - 1
if subactivationlast == 0 then
customvalue[latestid] = customvalue[latestid] / val
subactivation = nil
end
elseif subactivation == "expo" then
if gettingvalue ~= true then
if line ~= "getvalue" then
local val = tonumber(line)
subactivationlast = subactivationlast - 1
else
gettingvalue = true
end
else
local val = customvalue[tonumber(line)]
gettingvalue = false
subactivationlast = subactivationlast - 1
end
subactivationlast = subactivationlast - 1
if subactivationlast == 0 then
customvalue[latestid] = customvalue[latestid]^val
subactivation = nil
end
elseif subactivation == "random" then
if actionlast == 3 then
local id = tostring(line)
elseif subactivationlast == 2 then
if gettingvalue ~= true then
if line ~= "getvalue" then
local val1 = tonumber(line)
subactivationlast = subactivationlast - 1
else
gettingvalue = true
end
else
local val1 = customvalue[tonumber(line)]
gettingvalue = false
subactivationlast = subactivationlast - 1
end
elseif subactivationlast == 1 then
if gettingvalue ~= true then
if line ~= "getvalue" then
local val2 = tonumber(line)
subactivationlast = subactivationlast - 1
else
gettingvalue = true
end
else
local val2 = customvalue[tonumber(line)]
gettingvalue = false
subactivationlast = subactivationlast - 1
end
end
subactivationlast = subactivationlast - 1
if subactivationlast == 0 then
customvalue[id] = math.random(val1,val2)
latestid = id
subactivation = nil
end
elseif subactivation == "sin" then
if actionlast == 2 then
local id = tostring(line)
elseif subactivationlast == 1 then
if gettingvalue ~= true then
if line ~= "getvalue" then
local val1 = tonumber(line)
subactivationlast = subactivationlast - 1
else
gettingvalue = true
end
else
local val1 = customvalue[tonumber(line)]
gettingvalue = false
subactivationlast = subactivationlast - 1
end
end
subactivationlast = subactivationlast - 1
if subactivationlast == 0 then
customvalue[id] = math.sin(val1)
latestid = id
subactivation = nil
end
elseif subactivation == "cos" then
if actionlast == 2 then
local id = tostring(line)
elseif subactivationlast == 1 then
if gettingvalue ~= true then
if line ~= "getvalue" then
local val1 = tonumber(line)
subactivationlast = subactivationlast - 1
else
gettingvalue = true
end
else
local val1 = customvalue[tonumber(line)]
gettingvalue = false
subactivationlast = subactivationlast - 1
end
end
subactivationlast = subactivationlast - 1
if subactivationlast == 0 then
customvalue[id] = math.cos(val1)
latestid = id
subactivation = nil
end
end
else
if line == "Open" then
activation = line
activationlast = 1
elseif line == "Win" then
activation = line
activationlast = 1
elseif line == "Lost" then
activation = line
activationlast = 1
elseif line == "WinType" then
activation = line
activationlast = 1
elseif line == "AI" then
activation = line
activationlast = 1
elseif line == "Time" then
activation = line
activationlast = 1
elseif line == "createroid" then
activation = line
activationlast = 2
elseif line == "createroidatt" then
activation = line
activationlast = 5
elseif line == "createvalue" then
activation = line
activationlast = 2
elseif line == "add" or line == "minus" or line == "divide" or line == "times" or line == "expo" then
subactivation = line
subactivationlast = 1
elseif line == "random" then
subactivation = line
subactivationlast = 3
elseif line == "sin" or line == "cos" then
subactivation = line
subactivationlast = 2
elseif line == "changeid" then
activation = line
activationlast = 1
elseif line == "createfield" then
activation = line
activationlast = 4
elseif line == "createsfx" then
activation = line
activationlast = 17
elseif line == "change" then
activation = line
activationlast = 3

end
end
end
end
end

The error I get, comes particularilry from the createvalue activation :P

It is the customvalue[id] = val that causes it :/
Title: Re: What are you working on? :D
Post by: Aino on June 22, 2011, 04:27:24 AM
May it be that local variables disappears as the for loop runs again?
Title: Re: What are you working on? :D
Post by: annikk.exe on June 22, 2011, 05:08:45 AM
http://www.lua.org/pil/4.2.html

Think that might be it.  Make them all global and see if it works.
Title: Re: What are you working on? :D
Post by: Aino on June 22, 2011, 05:12:55 AM
Gonna do, tommorow :)
Title: Re: What are you working on? :D
Post by: Aino on June 22, 2011, 10:20:50 PM
I jsut removed the external map loading thing, causing too many problems -.-'
Title: Re: What are you working on? :D
Post by: Aino on June 23, 2011, 09:04:40 PM
Next on to-do list, create a new, less system req. CC :)
Title: Re: What are you working on? :D
Post by: Aino on June 23, 2011, 09:53:55 PM
A nice little code for thoose who want it:

Code: [Select]
function DrawHollowBox(x1,y1,x2,y2,r1,g1,b1,a1,r2,g2,b2,a2,size,style)

if style == 1 then --Every next colour :D
DrawLine(x1,y1,x2,y1,r1,b1,g1,a1,r2,b2,g2,a2,size)
DrawLine(x2,y1,x2,y2,r2,b2,g2,a2,r1,b1,g1,a1,size)
DrawLine(x2,y2,x1,y2,r1,b1,g1,a1,r2,b2,g2,a2,size)
DrawLine(x1,y2,x1,y1,r2,b2,g2,a2,r1,b1,g1,a1,size)
elseif style == 2 then --Horizontal fade
DrawLine(x1,y1,x2,y1,r1,b1,g1,a1,r2,b2,g2,a2,size)
DrawLine(x2,y1,x2,y2,r2,b2,g2,a2,r2,b2,g2,a2,size)
DrawLine(x2,y2,x1,y2,r2,b2,g2,a2,r1,b1,g1,a1,size)
DrawLine(x1,y2,x1,y1,r1,b1,g1,a1,r1,b1,g1,a1,size)
elseif style == 3 then --Vertical fade
DrawLine(x1,y1,x2,y1,r1,b1,g1,a1,r1,b1,g1,a1,size)
DrawLine(x2,y1,x2,y2,r1,b1,g1,a1,r2,b2,g2,a2,size)
DrawLine(x2,y2,x1,y2,r2,b2,g2,a2,r2,b2,g2,a2,size)
DrawLine(x1,y2,x1,y1,r2,b2,g2,a2,r1,b1,g1,a1,size)
end
end

Very useful for creating boxes that aren't having just one colour and fills the whole box :)
Title: Re: What are you working on? :D
Post by: Aino on June 23, 2011, 10:26:43 PM
This time I'll make CC more advanced, but easier to handle :)

If you have tested the last one, you'll see that Defense is affecting all asteroids, well, I'm trying to make it affect the asteroids with enemies nearby, and if you want, the other asteroids can provide the "threatned" ones with seedlings :)

And the global values won't be shown anymore, if you want to see the current values for the asteroid, hover your mouse over and it will display :)
Title: Re: What are you working on? :D
Post by: Aino on June 24, 2011, 01:40:08 AM
I've been coding CC so much that it automatically comes to me how/wat to write :D

there has been no problems for now, luckily :)
Title: Re: What are you working on? :D
Post by: Aino on June 24, 2011, 07:49:10 AM
I love the new CC setup, it's so much more dynamic than the last one :D
Title: Re: What are you working on? :D
Post by: Aino on June 24, 2011, 10:13:16 AM
The new CC:

*Spoiler alert: this image contains some of the features of the map "Adventure"!
(click to show/hide)

What do you think?
Title: Re: What are you working on? :D
Post by: Aino on June 24, 2011, 10:38:54 PM
I'm not good at names, but some of you might be: I need a name for this action: "Select asteroid to get a disallowed path"

You see how bad I am? xD

It's for the CC, to disallow a path, this time it's more complex but yet simplier than last, last time there were barriers, now a SPECIFIC neighbour is disallowd to be traveled to, instead it will choose another(if possible) path, rather than crossing that one :)

I'm also gonna add a double click shortcut, you can choose what it is gonna be, default is rally :P
Title: Re: What are you working on? :D
Post by: annikk.exe on June 24, 2011, 10:48:20 PM
Avoid.
Title: Re: What are you working on? :D
Post by: Aino on June 24, 2011, 11:09:54 PM
Damn xD

Why didn't I think of that D:

Anyways, thanks alot :)
Title: Re: What are you working on? :D
Post by: Aino on June 25, 2011, 03:06:35 AM
Yes! Now there are waypoints shown from each asteroid the player owns, if wanted... Also if you hover over and the waypoints are no shown, there will be waypoints flowing out of the asteroid hovered over!
Title: Re: What are you working on? :D
Post by: Aino on June 25, 2011, 05:58:30 AM
How can you visualize a shortcut, not IR but on the computer?
Title: Re: What are you working on? :D
Post by: Pilchard123 on June 25, 2011, 09:34:19 PM
...wut?

Also, trying to learn how to use Unity.
Title: Re: What are you working on? :D
Post by: Aino on June 25, 2011, 09:57:50 PM
Unity uses JavaScript :D
Title: Re: What are you working on? :D
Post by: annikk.exe on June 25, 2011, 09:59:19 PM
I am working on my computer.  It won't start. :<  Writing this from another machine...
Title: Re: What are you working on? :D
Post by: Aino on June 25, 2011, 10:23:41 PM
When does it fail?

[bad joke]Btw, this belongs in the Support / troubleshooting / bug reports :P[/bad joke]
Title: Re: What are you working on? :D
Post by: Pilchard123 on June 25, 2011, 11:05:52 PM
Unity uses JavaScript :D

A variant thereof, yes. The only real similarity is it's syntax. You can also use C# or Boo.

Upside, it's free.
Title: Re: What are you working on? :D
Post by: Aino on June 25, 2011, 11:34:12 PM
I got it installed, grats on your 500th post xD

I like C# best... Because it is very alike lua IMO :P
Title: Re: What are you working on? :D
Post by: Aino on June 26, 2011, 02:28:50 AM
Maybe I should update my AI, now it will save a file, saying how badass or frightened and crazy the AI is?

Maybe have several values like:

Combat (how often the AI will/wants to come into combat)
Defendant(this one might be combined with the Combat one, over 50 and it's more combat, under and it's more defending? At the middle it has no effect :D)

Risking(how much will the AI risk? 0 is nothing, gather a huge army for attacking and 100 is jsut sending the army at once, even if it's not large... Combine this with defendant and you get how many seedlings(percent) the AI will leave behind)

Caring(Will the ai send back seedlings after a lost battle? Or will it not care...)
Supportive(if the AI looses a battle, will it send some to support?)

This is just an Idea, it might not happen though. Atleast it needs tons of programming just to make it know when it lost something and some values should be increased D:

Then afterward I'll need another tons of codes to make the AI respond to lose/winning of battles...

Planning...
Title: Re: What are you working on? :D
Post by: Aino on June 26, 2011, 02:38:50 AM
Maybe just make a plain new AI?

This time supporting the Neigbour system CC has, you can use the old one if you set Movingroids = true though :D

This time I'll make it dependant on the neighbours, nothing will happen individually, like in the "old" one :P

Edit: Also, I'll make it occupate all the mpires you wish, not only one :D
Title: Re: What are you working on? :D
Post by: Aino on June 26, 2011, 02:55:52 AM
Because of several empires, I got no real idea how to save tha values, I don't want the AI's to act the same way, but still be dependant on the same Engine :D

So maybe I should make the best settings win? If it's your first play with the AI, every faction(AI owned) will get a very spread variety of number for each variable, the last AI standing is the one being saved?

After that you'll end up with AIs having something close to those values, and one empire WILL include the numbers on the save, so we can say it evolves randomly: Survival of the fittest FTW :D
Title: Re: What are you working on? :D
Post by: Aino on June 26, 2011, 05:28:24 AM
I added a frightened priority and removed if it is unexplored, still the AI must explore before any future stuff happens to the roid :D

The frightened priority tells that the AI might be in danger, though, the defend rating tells how often it will be recognized as in danger :P
Title: Re: What are you working on? :D
Post by: Aino on June 26, 2011, 06:51:57 AM
This looks right, right?

(click to show/hide)

IMO it looks right, so I'll start coding :P

I'm gonna remove the frightened proprty, it sucked, gonna replace it with Defend :D

Update: Planning alot now, I haven't started Coding after I released that list :O

This must be a good thing?
Title: Re: What are you working on? :D
Post by: Aino on June 26, 2011, 07:31:49 AM
Full plan:

Code: [Select]
--[[Priorities:

Attacked - 0
Need trees - X2 / 3 / 4 / 5
Attack - X2 / 3 / 4 / 5
Undiscovered - X2 / 3 / 4 / 5
Defend - X2 / 3 / 4 / 5

Priorites are matrixes, per empire.

If Defense is highest, Defend is always lowest priority.
If Colonise if highest, Need Trees is first and Undiscoverd comes after!
If Risk is highest, Attack is first.

Ratio for Defender/Risker/Coloniser is

Defense > Risk :

Need trees - X3
Attack - X5
Undiscovered - X4
Defend - X2

Defense > Colonise :

Need trees - X4
Attack - X3
Undiscovered - X5
Defend - X2

Risk > Colonise :

Need trees - X5
Attack - X2
Undiscovered - X4
Defend - X3

Risk > Defense :

Need trees - X3
Attack - X2
Undiscovered - X4
Defend - X5

Colonise > Defense :

Need trees - X2
Attack - X4
Undiscovered - X3
Defend - X5

Colonise > Risk :

Need trees - X2
Attack - X5
Undiscovered - X3
Defend - X4

Each of the values will be local values and they'll be added together, then divided by the amount of adding occasions.
Since the numbers are so slightly different, we must arrange them afterward from lowest to highest whole number.

This will give the perfect value, I guess...]]
--[[Variables needed:

Globals:
Priority - A matrix, contains a value that tells how attention sick an asteroid is.
Neighbour - A matrix, contains the Asteroid value for an ai to the selected asteroid.
NumNeighbours - An array, tells how many neighbours an asteroid have.
{
NeedTrees - An Array, spanning for all AI's, it gives the value for the default priority for the event: Need Trees. This variable is dependant of the three different personalities of the AI chosen.
Attack - Same story as above, only affecting the event: Attack
Discover - Same story as above, only affecting the event: Undiscovered
Defend - Same story as above, only affecting the event: Defend
} - Can be put in a matrix!
NumRoids - A single integer, containing a number that calls how many asteroids there are on the map.
NumFactions - A single integer, containing the value of how many AI controlled factions there are.
Locals:
--Coming and going
]]
--[[Behaviour:

Most of the behaviour is chosen by the properties of the AI

]]
--[[Coding:

{{Functions:

There will be two functions for the AI, creating a simple implented Engine.

}}

{{Function Names:

Function 1: Init() - Short for Initialize, runned once in LevelSetup()
Function 2: Engine() - Run all the time inside of a while loop in LevelLogic()

}}

{{Function 1: Init():

Init() will be reposible for:((

- Finding the amount of asteroids on the map.
- Setting arrays and matrixes.
- Finding the amount of controlled factions there are.
- Finding Neighbours for the asteroids.
- Sets the globals correctly.

))

}}

{{Function 2: Engine():

Engine() will be responsible for:((

- Executing the AI for every empire.

))

Engine() logic map:((

Pick a random asteroid:

Run through all the factions:

Owns the asteroid?

Yes:

Are we threatened by enemies around us?

Yes:

Priority(Chosen by personal attribs:Defend)

No:

Are there need for more trees?

Yes:

Priority(Chosen by personal attribs:NeedTree)

No:

[s]Priority(Impossible high :O)[/s]

Are there any Neighbours needing our help?

Yes:

Do we have seedlings to send?

Yes:

Send the seedlings to the closest neighbour needing them...

No:

Are we being patient and waiting for some more seedlings?

Yes:

Good, now wait!

No:

Get patient skill and be patient, we got nothing else to do!

No:

THIS ANSWER IS INVALID, DAMN YOU LOGIC MAP!

No:

Is it discovered yet?

Yes:

Does a non-neutral own it?

Yes:

Is there seedlings on it?

Yes:

Is there more than on our asteroid?

Yes:

Priority(Chosen by personal attribs:Defend)

No:

Priority(Chosen by personal attribs:Attack)

No:

Priority(Chosen by personal attribs:Attack)

No:

Does it have enemies on it?

Yes:

Priority(Chosen by personal attribs:Attack)

No:

Is it plantable?

Yes:

Priority(Chosen by personal attribs:NeedTree)

No:

Do the AI give a sh*t?

NO, not if this condition is true D:

No:

Priority(Chosen by personal attribs:Discover)

Are there Flowers on the trees?

Yes:

Are they detachable?(this is not questionable in the code :D)

Yes:

Detach it and plant it on a random dyson tree :D

No:

Wait...

No:

Damn D:

))

}}
]]

I'm guessing thats the plans :D

Random Fact: I love making thoose Logic Maps, but I don't make them very often D:

Edit:

New plans:

Code: [Select]
--[[Priorities:

Attacked - 0
Need trees - X2 / 3 / 4 / 5
Attack - X2 / 3 / 4 / 5
Undiscovered - X2 / 3 / 4 / 5
Defend - X2 / 3 / 4 / 5

Priorites are matrixes, per empire.

If Defense is highest, Defend is always lowest priority.
If Colonise if highest, Need Trees is first and Undiscoverd comes after!
If Risk is highest, Attack is first.

Ratio for Defender/Risker/Coloniser is

Defense > Risk :

Need trees - X3
Attack - X5
Undiscovered - X4
Defend - X2

Defense > Colonise :

Need trees - X4
Attack - X3
Undiscovered - X5
Defend - X2

Risk > Colonise :

Need trees - X5
Attack - X2
Undiscovered - X4
Defend - X3

Risk > Defense :

Need trees - X3
Attack - X2
Undiscovered - X4
Defend - X5

Colonise > Defense :

Need trees - X2
Attack - X4
Undiscovered - X3
Defend - X5

Colonise > Risk :

Need trees - X2
Attack - X5
Undiscovered - X3
Defend - X4

Each of the values will be local values and they'll be added together, then divided by the number of adding occasions.
Since the numbers are so slightly different, we must arrange them afterward from lowest to highest whole number.

This will give the perfect value, I guess...]]
--[[Variables needed:

Globals:
Priority - A matrix, contains a value that tells how attention sick an asteroid is.
Neighbour - A matrix, contains the Asteroid value for an ai to the selected asteroid.
NumNeighbours - An array, tells how many neighbours an asteroid have.
{
NeedTrees - An Array, spanning for all AI's, it gives the value for the default priority for the event: Need Trees. This variable is dependant of the three different personalities of the AI chosen.
Attack - Same story as above, only affecting the event: Attack
Discover - Same story as above, only affecting the event: Undiscovered
Defend - Same story as above, only affecting the event: Defend
} - Can be put in a matrix!
NumRoids - A single integer, containing a number that calls how many asteroids there are on the map.
NumFactions - A single integer, containing the value of how many AI controlled factions there are.
Locals:
--Coming and going
]]
--[[Behaviour:

Most of the behaviour is chosen by the properties of the AI

]]
--[[Coding:

{{Functions:

There will be two functions for the AI, creating a simple implented Engine.

}}

{{Function Names:

Function 1: Init() - Short for Initialize, runned once in LevelSetup()
Function 2: Engine() - Run all the time inside of a while loop in LevelLogic()

}}

{{Function 1: Init():

Init() will be reposible for:((

- Finding the amount of asteroids on the map.
- Setting arrays and matrixes.
- Finding the amount of controlled factions there are.
- Finding Neighbours for the asteroids.
- Sets the globals correctly.

))

}}

{{Function 2: Engine():

Engine() will be responsible for:((

- Executing the AI for every empire.

))

Engine() logic map:((

Pick a random asteroid:

Run through all the factions:

Owns the asteroid?

Yes:

Are we threatened by enemies around us?

Yes:

Priority(Chosen by personal attribs:Defend)

No:

Are there need for more trees?

Yes:

Priority(Chosen by personal attribs:NeedTree)

No:

Priority(Impossible high :O)

No:

Is it discovered yet?

Yes:

Does a non-neutral own it?

Yes:

Is there seedlings on it?

Yes:

Is there more than on our asteroid?

Yes:

Priority(Chosen by personal attribs:Defend)

No:

Priority(Chosen by personal attribs:Attack)

No:

Priority(Chosen by personal attribs:Attack)

No:

Does it have enemies on it?

Yes:

Priority(Chosen by personal attribs:Attack)

No:

Is it plantable?

Yes:

Priority(Chosen by personal attribs:NeedTree)

No:

Do the AI give a sh*t?

NO, not if this condition is true D:

No:

Priority(Chosen by personal attribs:Discover)

Are there Flowers on the trees?

Yes:

Are they detachable?(this is not questionable in the code :D)

Yes:

Detach it and plant it on a random dyson tree :D

No:

Wait...

No:

Damn D:

Check my priority:

Is it set for me to do something?

Yes:

What is the task?

Attack:

--IMPORTANT INFO: This is a neighbours job!

Are there enough seedlings to kill the enemy?

Yes:

[coarse language!!!]Send thoose seedlings! We're raping those buttholes![/coarse language]

No:

Wait for more to come!

NeedTrees:

Are there enough seedlings for a tree?
(why need ten, when we can do it with one seed in reality?)

Yes:

Plant a dyson tree...

No:

Wait then...

Discover:
([facepalm]It's called EXPLORE...[/facepalm])

--IMPORTANT INFO: This is a neighbours job!

Are there atleast one seed on the asteroid and atleast 10*(Defend-Risk(if returning minus, do a 0!)) more to prevent any surprise buttsecks?

Yes:

Send the seed, to explore the world!
(there might be several, but maybe prevented by the limit :o)

No:

Wait... I think, unless we take a risk :D

Defend:

--IMPORTANT INFO: This is a neighbours job!

Obvious, wait for seedlings -.-

If risk is high enough:

Is there enough seedlings to buttrape the enemy?

Yes:

Do it!

No:

Okay :/

No: (I haz to do something :o)


Check all neighbours:

Are there lower priorities than me?

Yes

Priority(Nighbour+1)

Do we have seedlings to send?

Yes:

Send the seedlings to the closest neighbour needing them...

No:

Are we being patient and waiting for some more seedlings?

Yes:

Good, now wait!

No:

Get patient skill and be patient, we got nothing else to do!

No:

I'm that best, ain't I?

))

}}
]]

327 lines of plans, thats pretty neat :D
Title: Re: What are you working on? :D
Post by: Aino on June 26, 2011, 12:42:30 PM
Ok, the AI is up and running(retardidly) and shows significantly difference in behaviour :D

Some of the AIs are careful with attacking(yeah, they attack: dangerously too!), meaning they send more than double of your amount of seedlings, and cares less(risking much)...

I got it working perfectly with 11 factions(max)... though the AI needs some tweaking, like planting trees on neutral(greys) roids, I don't really think there is more...

And the AI seems to be lagless, if you have 100 asteroid, there won't be much lag, unless all asteroids reach eachother xD, but in a classic map, it won't lag :P
Why? Because of the neighbour system in the new CC and the New AI now, though it doesn't support moving asteroids, but I can change it to do so, but most maps are static as far as I know :)

Edit: Added a picture, going to sleep, I'm dead tired now...
Title: Re: What are you working on? :D
Post by: Aino on June 26, 2011, 09:42:02 PM
I need a new logic map, and the defend priority is going into the trash :P

The attached picture says why, the AI has alot of seedlings to attack me, but the defend priority sucks that down D:

Or maybe I've done it wrong?
Title: Re: What are you working on? :D
Post by: Aino on June 27, 2011, 05:55:53 AM
OMG, almost fazing out, the AI is traveling through multiple asteroid at the time if possible, but also seems to be godly aware of the priorities :D

But I got a problem with the priorities building up, the most common problem in creating this AI :S
*this results in long delays and the AI sending seed from one asteroid to another all the time!
Title: Re: What are you working on? :D
Post by: annikk.exe on June 27, 2011, 07:23:57 PM
I am working on my computer.  It won't start. :<  Writing this from another machine...

Fixed.

As a side effect of the fix, my CPU is 100Mhz faster than before, and my memory is 267Mhz faster.  w00t.
Title: Re: What are you working on? :D
Post by: Aino on June 27, 2011, 09:59:10 PM
What the heck? You made your Computer better without putting in new parts? Or did you put in new parts? :D
Title: Re: What are you working on? :D
Post by: Aino on June 27, 2011, 10:45:52 PM
Since the AI has failed in some ways all te time, I'll try once again... this time using only two priorities :)

So 0 is being under attack and the amount of roids is everything else, that way the AI will ignore any other actions while under attack and if not, the AI will work normally :)

So now, since the AI has different flavours of doing stuff, when the neighbours priority is 100(lets say 100 instead of the amount of roids) it will send, if there is two, the AI will send to the neighbour which needs the thing the AI desires the most(war, trees or adventuring(discovery :D))...

The old AI failed by setting priroty to incredible high and not going down when there is nearby asteroids :/
Title: Re: What are you working on? :D
Post by: annikk.exe on June 27, 2011, 11:05:54 PM
What the heck? You made your Computer better without putting in new parts?

Yes.
Title: Re: What are you working on? :D
Post by: Aino on June 28, 2011, 12:06:50 AM
What the heck? You made your Computer better without putting in new parts?

Yes.

You're so lucky >.<
Title: Re: What are you working on? :D
Post by: Aino on June 28, 2011, 02:32:38 AM
I give up >.<

Seriously, after 3-4 times of rewriting the whole system, the AI now either fails to do a send command or crashes, if it crashes the first time, it fails at the second and then crashes at the thrid attempt -.-'

I'm going to re-do the current Alien AI instead, optimising and changing it to get thoose different behaviours x.x
Title: Re: What are you working on? :D
Post by: Aino on June 28, 2011, 11:04:34 AM
Annikk, maybe, if you have time, consider optimising you AI?

It lags a little on my map, it has 41 roids D:

Maybe yuoc an do some kind of static neighbouring thing, just an idea...
Title: Re: What are you working on? :D
Post by: annikk.exe on June 28, 2011, 06:13:50 PM
IAIv3 will appear eventually, but I'm lacking motivation for that right now, partly because I'm knee-deep in the 3D engine, but mainly because nobody has programmed an AI that can beat it yet.  :P

If someone makes an AI that can take on IAI in a fair fight, I would have to do something about that!

Still, noted... next IAI must be more efficient with clock cycles.
Title: Re: What are you working on? :D
Post by: Aino on June 28, 2011, 11:08:20 PM
Ok, I'll build an AI I hope can give your AI a kicak in the back :P
Title: Re: What are you working on? :D
Post by: Aino on June 29, 2011, 01:04:55 AM
I wonder:

How do you create a function that can be changed in-game... or I mean that has changeable fields, like for example GetAsteroid(id).Radius = 1000. The GetAsteroid is the function and after the dot comes the field I change, but how do you set up your own changeable function? So I make a function called Something() with arguments x,y and then how do I set up the function to change the x and y in-game?
Title: Re: What are you working on? :D
Post by: dragoonreas on June 29, 2011, 01:35:38 AM
I think what you're looking for might be the Lua equivalent of a class (http://www.lua.org/pil/16.1.html).

I actually used the page linked above and this page (http://www.lua.org/pil/16.4.html) when I was figuring out how to re-writing annikk's Gravity Template into a class. You can download it from this post (http://www.dyson-game.com/smf/index.php?topic=810.msg6129#msg6129) and have a look if you want. The 400 something line function called DynamicGravityEngine at the bottom is the class, and there's actually also a nested class (a class within a class) called GravityAsteroid in there too.
Title: Re: What are you working on? :D
Post by: Aino on June 29, 2011, 02:10:33 AM
Thanks, I'll be reading it, but first I'm going to play TF2 :D
Title: Re: What are you working on? :D
Post by: Bonobo on June 29, 2011, 03:51:45 AM
@dragoonreas: You’re BACK?! How nice to see you veteran mapper again here :)
Title: Re: What are you working on? :D
Post by: Aino on June 29, 2011, 03:59:27 AM
The text is surprisingly long, so I forget one part before I start reading another one D:

EDIT:

(http://i749.photobucket.com/albums/xx131/DB81397/Hmmm.jpg)

THERES ANOTHER LINK :O

EDIT 2:

I have... Alot to learn! :D
Title: Re: What are you working on? :D
Post by: dragoonreas on June 29, 2011, 04:17:30 AM
@dragoonreas: You’re BACK?! How nice to see you veteran mapper again here :)
Thanks :)

To be honest though I never really left, I was just in lurker mode due to how much Uni work I've been getting… and being introduced to World of Warcraft probably didn't help either.

The text is surprisingly long, so I forget one part before I start reading another one D:
It's probably going to take more than one read through to understand, especially if you haven't read any of the previous sections. I think looking at the code in the second link may actually be prove more helpful than reading all the stuff in the first link (at least it was when I first came across it).
Title: Re: What are you working on? :D
Post by: Aino on June 29, 2011, 04:26:54 AM
Hmm, gotta ask you:

Does this work:

Code: [Select]
Units = {}{}
?

But I do use:

Code: [Select]
Units = {}
Units[NumberofBases] = {}
for i = 1,NumEnemies+1 do
Units[NumberofBases][i] = 0
end

though inside of the self array:

Code: [Select]
local self = {

BaseNumber = NumberofBases
Position = {

X = x
Y = y

}
Owner = 0
Units = {}
Units[NumberofBases] = {}
for i = 1,NumEnemies+1 do
Units[NumberofBases][i] = 0
end

}
:)
Title: Re: What are you working on? :D
Post by: Pilchard123 on June 29, 2011, 04:55:34 AM
DR, did you know that according to massiveonlinegamer, in October last year, Azeroth had a population of approx. 12mil? That's somewhere betwwen the population of Chad and Zimbabwe, or Ohio and Pensylvania states. (data according to mog, from Activision and Wikipedia)
Title: Re: What are you working on? :D
Post by: Aino on June 29, 2011, 06:27:26 AM
Hmm, when I try to run this:

Code: [Select]
function LevelSetup()
Globals.G.Asteroids=0
Globals.G.EnemyFactionsMin=0
Globals.G.EnemyFactionsMax=0
SetBackdropColour(0,0,0)
AddAsteroid(0,0)
Globals.Flowers.Available = 0
Initialization()
BasicSaveFolder = "C:\\EufloriaSaves\\"
end

function LevelLogic()
GetAsteroid(0).Radius = 0
GetAsteroid(0):Hide(1)
GetAsteroid(0):SetVisible(1,false)
end

function Initialization()

NumberofBases = 0
Data = {}

end

--[[function AddBase(x,y)

NumberofBases = NumberofBases + 1

Data[NumberofBases] = {

ID = NumberofBases
Position = {

X = x
Y = y

}
Owner = 0
Units = {}
Units[NumberofBases] = {}
for i = 1,NumEnemies+1 do
Units[NumberofBases][i] = 0
end
Draw = true
Production = math.random()

}

end

function GetBase(id)

local self = {

ID = Data[NumberofBases].ID
Position = {

X = Data[NumberofBases].Position.X
Y = Data[NumberofBases].Position.Y

}
Data[NumberofBases].Owner = 0
Data[NumberofBases].Units = {}
for i = 1,NumEnemies+1 do
Data[NumberofBases].Units[NumberofBases][i] = 0
end
Data[NumberofBases].Draw = true
Data[NumberofBases].Production = math.random()
}

end

function LevelDraw()

if NumberofBases > 0 then

for i = 1,NumberofBases do

DrawSprite(7,GetBase(i).Position.X,GetBase(i).Position.Y,1,1,1,1,50)

end

end

end

function ScreenDraw()

end]]

Uncommented, it crashes D:

EDIT:

Here, fixed the calling in GetBase(), but still crashing :/

Code: [Select]
function LevelSetup()
Globals.G.Asteroids=0
Globals.G.EnemyFactionsMin=0
Globals.G.EnemyFactionsMax=0
SetBackdropColour(0,0,0)
AddAsteroid(0,0)
Globals.Flowers.Available = 0
Initialization()
BasicSaveFolder = "C:\\EufloriaSaves\\"
end

function LevelLogic()
GetAsteroid(0).Radius = 0
GetAsteroid(0):Hide(1)
GetAsteroid(0):SetVisible(1,false)
end

function Initialization()

NumberofBases = 0
Data = {}

end

function AddBase(x,y)

NumberofBases = NumberofBases + 1

Data[NumberofBases] = {

ID = NumberofBases
Position = {

X = x
Y = y

}
Owner = 0
Units = {}
Units[NumberofBases] = {}
for i = 1,NumEnemies+1 do
Units[NumberofBases][i] = 0
end
Draw = true
Production = math.random()

}

end

function GetBase(id)

local self = {

ID = Data[id].ID
Position = {

X = Data[id].Position.X
Y = Data[id].Position.Y

}
Data[id].Owner = 0
Data[id].Units = {}
for i = 1,NumEnemies+1 do
Data[id].Units[id][i] = 0
end
Data[id].Draw = true
Data[id].Production = math.random()
}

end

function LevelDraw()

if NumberofBases > 0 then

for i = 1,NumberofBases do

DrawSprite(7,GetBase(i).Position.X,GetBase(i).Position.Y,1,1,1,1,50)

end

end

end

function ScreenDraw()

end
Title: Re: What are you working on? :D
Post by: Aino on June 29, 2011, 06:53:55 AM
I think I'll make this a little better after I'm done with what I'm going to work on :)
Title: Re: What are you working on? :D
Post by: dragoonreas on June 29, 2011, 08:04:40 AM
Hmm, gotta ask you:

Does this work:

Code: [Select]
Units = {}{}
?
That piece of code looks like you're trying to assign two empty tables to the variable Units. If you had a coma between to two pairs of brackets I know that Units would get assigned the first empty table and the second would be discarded (as described here (http://www.lua.org/pil/4.1.html)), but as you've got it I would have to guess it's syntactically incorrect and would throw and error.

But I do use:

(click to show/hide)

though inside of the self array:

(click to show/hide)
:)
That's almost right. Here's the section on Matrices and Multi-Dimensional Arrays (http://www.lua.org/pil/11.2.html)… and HERE (http://www.lua.org/pil/index.html) is the contents page for the Lua site I seem to like spamming links for (go forth and explore! I'm sure you'll learn heaps of stuff, I know I did. ;)).


DR, did you know that according to massiveonlinegamer, in October last year, Azeroth had a population of approx. 12mil? That's somewhere betwwen the population of Chad and Zimbabwe, or Ohio and Pensylvania states. (data according to mog, from Activision and Wikipedia)
I didn't know that, but I'm not surprised :P


Hmm, when I try to run this:

(click to show/hide)

Uncommented, it crashes D:

EDIT:

Here, fixed the calling in GetBase(), but still crashing :/

(click to show/hide)

I'm a bit busy at the moment, but after just glancing over it I'd suggest you try implementing some accessor and mutator methods (also know as getters and setters), rather than trying to use the variables directly. That second link in my original post on privacy should tell you about these kind of methods and why it's good to use them. ;)
Title: Re: What are you working on? :D
Post by: Aino on June 29, 2011, 08:18:19 AM
Thanks, you're lots of help :D
Title: Re: What are you working on? :D
Post by: Aino on June 29, 2011, 08:43:46 AM
God damnit, I question MYSELF more questions which I can't answer before looking at a code for 5 mins, then after I leave the code I'll probably ask myself the same question, which takes me 5 mins to solve while looking at the same code...

I wondered how I could add and get a base information, I can just do newBase() and inside have a local function that is named getBase, but how do I make it return the stuf I want. Like in Eufloria, you have GetAsteroid(id).Owner, this is an example... you also have Radius and SedDistance and Position and Attributes... How do you do it, mind explaining me when you're not busy? I can wait :)
Title: Re: What are you working on? :D
Post by: Aino on June 30, 2011, 05:42:47 AM
Doing the new AI, while playing Minecraft :o

So the new AI will be Alien AI V2, it will have a new combating system, so it will be much more efficient and smarter :)
Title: Re: What are you working on? :D
Post by: Pilchard123 on June 30, 2011, 06:19:32 AM
Ah, good ol' Minecraft, where would we be wthout it?

Mars by now, probably. That thing is the biggest time/life sink I've ever come across, barring possibly WoW. That doesn't mean I don't love it though.
Title: Re: What are you working on? :D
Post by: Aino on June 30, 2011, 06:26:05 AM
Playing WoW? I quit long time ago, reached level 42, if thats the WoW you talk about :P
Title: Re: What are you working on? :D
Post by: Pilchard123 on June 30, 2011, 06:29:58 AM
I've never actually played WoW (yes, I mean World of Warcraft), but I have seen the effects of it, viz. lack of any productive work. Minecraft on the other hand...
Title: Re: What are you working on? :D
Post by: Aino on June 30, 2011, 06:31:46 AM
Ran into a problem, luckily I've commented alot now :)

Code: [Select]
function LevelSetup()

Globals.G.Asteroids=0
Globals.G.EnemyFactionsMin=0
Globals.G.EnemyFactionsMax=0
SetBackdropColour(0,0,0)
Globals.G.GreysProbability = 0
Globals.G.GreysMin=0
Globals.G.GreysMax=0

for i = 0,100 do

a = AddAsteroid(math.random(-10000,10000),math.random(-10000,10000))

if i > 0 and i <= 3 then

a.Owner = i
a:AddSeedlings(40)

else

a.Owner = 0

end

end

AIInit()

end

function LevelLogic()
while GameRunning() do

AIEngine()

coroutine.yield()
end
end

function AIInit()

--Set the globals correct:
Globals.AI.GraceTimer = 9999999

--Create variables needed for the AI
--Changeable AI, be sure to change them if you need!
AIFaction = {2,3}
AINumIterations = 10
AIGraceTime = 5 --Even though this one is here, it doesn't mean all the other normal AI variables work!
--Unchangeable, there is no real value to change...
AIPriority = {}
AINumFactions = 0
AINumRoids = -1
AINeighbour = {}
AINumNeighbours = {}
Engine = AIEngine()

--Run through all possible factions and chack if they are included, this way we can make the matrices for priorities.
for i = 1,10 do

if AIFaction[i] ~= nil then

AINumFactions = AINumFactions + 1
AIPriority[i] = {}

else

break;

end

end

--Run from 0 to a high number(more than what you would want as asteroids on a map) to find any asteroid.
for i = 0,1000 do

if GetAsteroid(i) ~= nil then

--Set all variables for the asteroids...
AINumRoids = AINumRoids + 1
AINumNeighbours[i] = 0
AINeighbour[i] = {}

for j = 1,AINumFactions do

AIPriority[AIFaction[j]][i] = 1000

end

else

break;

end

end
end

function AIEngine()

--If the gracetime is over and the AI hasn't checked yet, then the AI must do so!
if GetGameTime() > AIGraceTime and AIChecked ~= true then

--The AI will run through all of the asteroids twice to find any neighbouring asteroids.
for i = 0,AINumRoids do

for j = 0,AINumRoids do

if i ~= j then

local Xd = GetAsteroid(i).position.x-GetAsteroid(j).position.x
local Yd = GetAsteroid(i).position.y-GetAsteroid(j).position.y
local dist = (Xd^2)+(Yd^2)

if dist < GetAsteroid(i).SendDistance+GetAsteroid(j).Radius then

--As a match occours, it will make the asteroid a neighbour so the AI understands it.
AINumNeighbours[i] = AINumNeighbours[i] + 1
AINeighbour[i][AINumNeighbours[i]] = GetAsteroid(j)

end

end

end

end

AIChecked = true

else

--The gracetime is over and the AI has checked, then we iterate the chosen amount of times and...

for iteration = 1,AINumIterations do

--Choose a random asteroid to check:
local roid = GetAsteroid(math.random(0,AINumRoids))
--But also include the ID for simplicity:
local roidid = roid.ID

--Now run through all of the factions, to allow them to change the priority of the roids

for factionid = 1,AINumFactions do
local faction = AIFaction[factionid]
local ChangedPriority = false

--Check wether the faction owns the asteroid or not.
if roid.Owner == faction then
--Check conditions on the asteroid:
if roid:GetNumSeedlingsExcluding(faction) > roid:GetNumSeedlings(faction)/4 then
--The AI found out that the asteroid is under attack, so we must set the priority to lowest possible, 0!
if AIPriority[faction][roidid] ~= 0 then

AIPriority[faction][roidid] = 0
ChangedPriority = true

end

elseif roid:GetNumSeedlingsExcluding(faction) == 0 then

if AIPriority[faction][roidid] == 0 then
--We're not under attack, but our priority still says so, let's get rid of that!
AIPriority[faction][roidid] = AINumRoids*4
ChangedPriority = true

end

end

if roid:GetNumTrees() < roid.TreeCap then

if AIPriority[faction][roidid] > AINumRoids*1 then
--We need trees and our priority is high enough to not reset any attack priorities!
AIPriority[faction][roidid] = AINumRoids*1
ChangedPriority = true
if roid:GetNumSeedlings(faction) >= 10 then

roid:PlantDysonTree()

end
end

else

if AIPriority[faction][roidid] == AINumRoids*1 then
--We don't need trees, but our priority says so, let's get rid of that!
AIPriority[faction][roidid] = AINumRoids*4
ChangedPriority = true

end

end

else

end

if ChangedPriority == true then
--If we changed any priority, we have to reset all the other, "meaningless" priorities...
for checkedroid = 0,AINumRoids do
if AIPriority[faction][checkedroid] ~= 0 and AIPriority[faction][checkedroid] ~= AINumRoids*1 and AIPriority[faction][checkedroid] ~= AINumRoids*2 and AIPriority[faction][checkedroid] ~= AINumRoids*3 then

AIPriority[faction][checkedroid] = AINumRoids*4

end
end

else
--if we didn't then we must check the neighbours of all asteroids if they are important.
for checked = 0,AINumRoids do
local checkedroid = GetAsteroid(i)
if checkedroid.Owner == faction then
for j = 1,AINumNeighbours[checked] do
if AIPriority[faction][AINeighbour[checked][j].ID] < AIPriority[faction][checked] then
AIPriority[faction][checked] = AIPriority[faction][AINeighbour[checked][j].ID] + 1
if AIPriority[faction][AINeighbour[checked][j].ID] ~= AINumRoids*3 then
if checkedroid:GetNumSeedlings(faction) > 0 then

checkedroid:SendSeedlingsToTarget(faction,checkedroid:GetNumSeedlings(faction),AINeighbour[checked][j])

end
end
end
end
end
end
end
end
end
end
end

The problem is the "local roid = GetAsteroid(math.random(0,AINumRoids))" near the start of the AIEngine() function.
Title: Re: What are you working on? :D
Post by: Aino on June 30, 2011, 06:34:03 AM
I've never actually played WoW (yes, I mean World of Warcraft), but I have seen the effects of it, viz. lack of any productive work. Minecraft on the other hand...

Lack of productive work? Blizzard lack of that?

Minecraft is neat though, you can join me if you get in on the server I play on :D

It's whitelisted though: http://www.minecraftforum.net/topic/409940-newish-server-looking-for-epic-builders/page__gopid__5718849#entry5718849
Title: Re: What are you working on? :D
Post by: Pilchard123 on June 30, 2011, 06:38:52 AM
I think that Math.Random is a decimal, you might want to round it.
Title: Re: What are you working on? :D
Post by: Aino on June 30, 2011, 06:46:52 AM
Nope, that's not the problem, I ran the code before stuff was checked appearantly :S
Title: Re: What are you working on? :D
Post by: annikk.exe on July 01, 2011, 07:13:22 AM
I'm all out of coding energy for the last few days now..
Maybe gogo at the weekend again..
Title: Re: What are you working on? :D
Post by: Aino on July 03, 2011, 02:47:38 AM
Going to make a new map, I seek beta testers already, but not so loudly yet...

I'm going to take a few brakes from the coding, maybe I'll release Adventure soon, I got no idea yet... Atleast I'm making a map :)
Title: Re: What are you working on? :D
Post by: Aino on July 07, 2011, 01:53:19 AM
Yay, Reinforcemts: Checked :D

Now to go through some maps with reinforcements and then allow for all tools :P
Title: Re: What are you working on? :D
Post by: Pilchard123 on July 07, 2011, 06:19:17 AM
Now, you know how I said that I might be able to use EUCLiD for this summer project? Well, I'm fairly sure I'll be able to use it now, all I have to do is get approval from the course supervisor. Expect news soon.
Title: Re: What are you working on? :D
Post by: Aino on July 07, 2011, 06:37:36 AM
Awesome, but PÅilchard, do you have plans becoming a game programmer?

i do :D
Title: Re: What are you working on? :D
Post by: Aino on July 08, 2011, 01:25:12 AM
Adventure might take a while :S

Productivity: 1 map per day

Final goal: around 25(the normal campaign)

Currently done: 5 maps

Maybe I'll update this often, so you can see the progress :)
Title: Re: What are you working on? :D
Post by: Pilchard123 on July 08, 2011, 02:04:40 AM
EUCLiD news! I'm starting to work on it as soon as I have a chance. First, though, I've got to get requirements from the end user - that's where you come in. If you could post ideas/requests for features (sensible please, not "WOO MAEK IT FLY AN BAKE A CAK IMMA TROLL") in the EUCLiD thread, that would be a really big help. I know you've all kinda said what you'd like before, but I just really want them consolidated for the evidence that I have to produce. Unfortunately, I probably won't be able to make it Mac compatable just yet, I don't have the time to learn a language that insn't Winfaildows-only before the deadline. Link below, also in maps forum category.

http://www.dyson-game.com/smf/index.php?topic=834.30
Title: Re: What are you working on? :D
Post by: Aino on July 09, 2011, 12:16:13 AM
After I'm done with Adventure, I'll make a reinforcement function That works outside of Adventure, currently it's so hard sticked to Adventure I can rip it out magically :/
Title: Re: What are you working on? :D
Post by: Aino on July 09, 2011, 12:52:08 AM
The map gets small laggy when I have Minecraft, Eufloria, Firefox, Skype, Steam, Lots of other crap, Windows Explorer and Notepad++ up D:

This is bad!
Title: Re: What are you working on? :D
Post by: Aino on July 10, 2011, 01:52:51 AM
Yay, I fixed external map making, due to dofile()

And to help you, it even checks if you don't have more maps left to do :D

I'll need to do a tutorial on how to install the maps though, it'll go smooth hopelyfully :)
Title: Re: What are you working on? :D
Post by: annikk.exe on July 11, 2011, 02:49:00 PM
This:

I'll need to do a tutorial on how to install the maps though

..is why external files is a flawed idea.. :p  It's less convenient for the players which makes it bad.
Title: Re: What are you working on? :D
Post by: Aino on July 11, 2011, 09:04:51 PM
I know that annikk, but if I don't I'll probably end up with a 5000 lines long code, and if I close most of the functions, that stupid open thing happens at randopm when I write and I get really pissed off. So either installation or forever to make...
Title: Re: What are you working on? :D
Post by: annikk.exe on July 12, 2011, 02:27:39 AM
I remember you asked me about that problem before, and I looked and couldn't find anything.

I looked again, and this time I found something.  :>  In Notepad++, you can instantly minimize ALL the functions by pressing alt-0.  There is more as well - if you check the View menu, there are a series of shortcut keys for collapsing or uncollapsing the functions in different ways.  Hopefully there should be enough there to make it a lot more convenient to minimize accidentally-opened stuff.
Title: Re: What are you working on? :D
Post by: Pilchard123 on July 12, 2011, 02:30:21 AM
You could make a self-extracting RAR. That would do all the installing for you.
Title: Re: What are you working on? :D
Post by: Aino on July 12, 2011, 03:47:32 AM
Thats true... I might do that, but I'll do it once the levels are done...
Title: Re: What are you working on? :D
Post by: Aino on July 15, 2011, 07:50:47 AM
After the Map Editor, I'll make a minimap thingy... prbly the last thing I'll make before I'll go for a weeks vacation :)

And after that to the beach every single day, until the vaction is over. I still have afternoons to play though :D
Title: Re: What are you working on? :D
Post by: annikk.exe on July 15, 2011, 08:41:35 AM
(I'm starting to feel like I'm only raining on your guys parade... but...  oh well, here goes anyway...)

Put yourself in the shoes of someone downloading levels from the forums.  Would you rather download a file with extension .lua or .exe ?
Executable files can contain viruses and stuff.. if people are used to seeing .lua files and come across a thread where a .exe is offered, they are likely to be instantly suspicious.
Title: Re: What are you working on? :D
Post by: Aino on July 15, 2011, 08:48:39 AM
What are you reffering to? The Adventure or is it something totally random?
Title: Re: What are you working on? :D
Post by: annikk.exe on July 15, 2011, 04:06:48 PM
This:

Quote
You could make a self-extracting RAR. That would do all the installing for you.

That would be a .exe file.
Title: Re: What are you working on? :D
Post by: Aino on July 15, 2011, 10:08:40 PM
I think it would be some archive file, not an .exe :P

But I can give people the rar to install the maps manually :)
Title: Re: What are you working on? :D
Post by: annikk.exe on July 16, 2011, 12:11:42 AM
If it's self-extracting, it's an .exe.  But yes, you could just give people a .rar file.

I still think it's a step in the wrong direction though.   I feel being able to download a level in the form of a single file without the need to extract it or do anything else beyond placing in the correct folder, is an ideal system for the people who play our levels.
Title: Re: What are you working on? :D
Post by: Aino on July 16, 2011, 12:16:01 AM
Yes, it would be much easier for people to play it... But the file size would enter 160 KB(5000+(+++++) lines), meaning it's very hard to find where to go(it is already very hard!), so you end up with this system :/

Edit: We can see how it turns out :) Maybe I can make a map installing it for you, even though that might be a little stupid x.x
Title: Re: What are you working on? :D
Post by: annikk.exe on July 16, 2011, 12:27:02 AM
If you really want to work in seperate files, that should be fine... however I would recommend compiling it all into one massive .lua file which you then release.

That would mean you have 2 copies of your project.  One is a single 160kb .lua file for end-users to download and play.  The other is a series of .lua files, split up to make it easier to work on different sections.  Thus if you needed to go back later on and change stuff, you could use your multi-file project and then just recompile to a single .lua file when you're finished updating it to the new version.  Would that approach work better?
Title: Re: What are you working on? :D
Post by: Aino on July 16, 2011, 12:57:41 AM
Hmm, but then I'll have to do the map loading for the fifth time Dx

I'll see how it turns out, as you'll probably be playing on 60(my hope) different levels, it's not that bad to just install it either manually or automatically ONCE...
Title: Re: What are you working on? :D
Post by: Aino on July 16, 2011, 03:07:06 AM
Made the rally system in 40 minutes... This is great :D

I'll post a picture soon :)
Title: Re: What are you working on? :D
Post by: Aino on July 16, 2011, 03:49:30 AM
Pictures coming(look at the attachements!)

So, the setting is pretty ok, balls in the blue box represents asteroids(duhh!). The ball colours say something about their alignement to you, obviously you can see for yourself which one is friendly to you!

Now, there is more features than on the pictures, for now you can see that you can hold over the blue box to magnify it 3 times, you can see the whole map and which faction the asteroid is belonging to(friendly/non-firendly!), and you get to see a ring "flashing" in red when your asteroids are assaulted, if you assault someone and it seems you'll win it will flash green on that asteroid.

Also, take a look at the camera tracker, took me another 20 minutes to make xD

What  I'm planning to make is:

Instead of mixing colours, I'll make 2 more sprites, one red and one green, the more seedlings you or the enemy have, the bigger the balls are. Thoose balls are very transparent though!
Title: Re: What are you working on? :D
Post by: Pilchard123 on July 16, 2011, 06:09:30 AM
That...is cool.
Title: Re: What are you working on? :D
Post by: Aino on July 16, 2011, 07:23:19 AM
Heh, I'll polish it some more and stuff later...
Title: Re: What are you working on? :D
Post by: Aino on July 16, 2011, 07:28:04 AM
I also have plans adding this to adventure :D

So, when CC is activated/allowed it will show waypoints and rallypoints too :D

Edit: I'll also make a right click to teleport the camera to the point :P I guess this will automatically be ignored if you're not allowed to see there?
Title: Re: What are you working on? :D
Post by: AWS on July 20, 2011, 08:30:19 AM
HAIL!!
finally, im getting back into making a level.

im using Roid forge to see what kind of resutls i can achieve with that.
ive incorporated hitman's rallysystem but am having trouble getting it to work outside of the test map it came with.. not sure why its not working in mine.

next is to add some devilish AI.
then testing begins...

 ;D
Title: Re: What are you working on? :D
Post by: annikk.exe on July 20, 2011, 06:04:53 PM
Awesome dude. :>
Hopefully RoidForge will work good for you.

I am temporarily switching my focus away from Eufloria so I can write a new tune.
Title: Re: What are you working on? :D
Post by: Rudolf on July 22, 2011, 03:56:09 AM
Cool stuff this! We should do a community mod pack soon, rather than a map pack :-D
Title: Re: What are you working on? :D
Post by: hitman271 on July 23, 2011, 06:12:47 AM
HAIL!!
finally, im getting back into making a level.

im using Roid forge to see what kind of resutls i can achieve with that.
ive incorporated hitman's rallysystem but am having trouble getting it to work outside of the test map it came with.. not sure why its not working in mine.

next is to add some devilish AI.
then testing begins...

 ;D

Ha, this made me happy to read this. Friend me on steam with hits271 or just send a message on this forum for rallysystem troubleshooting.

Make sure you paste whatever is included in the RallyModeStart to RallyModeEnd comments in the beta level code. I'm going to upload an easier to implement version by the end of today
Title: Re: What are you working on? :D
Post by: annikk.exe on July 23, 2011, 07:46:02 AM
I'm a bit sad today, because after about 3 months of being in denial I have finally admitted to myself that the data on my music PC is lost.
I don't think I will be able to get it back, unless I pay a large sum of money to have one of the hard drives taken apart in a clean room and get the data manually extracted by a trained technician.  I'm not really up for that, and can't really afford it anyway..

So after moping around and hugging my kitten for a little while, I gathered the resolve to just launch Cubase anyway and just do some programming.  No sooner had I launched it, than a window appeared saying that the DRM USB licence key thingy did not have a valid licence on it, and therefore Cubase couldn't launch.  I tried replugging it, and tried it in all the different USB slots, but I couldn't get it to work.

I've been pretty frustrated with Cubase for a while anyway, and this was the straw that broke the horse's back.  I uninstalled it, along with a heap of other seed that has accumulated on this machine during the period when my main machine had died and my music PC was the only one I had.  Now I've installed Ableton Live and I'm going to give that a serious go.  It's going to be kind of annoying having to learn a whole new sequencer but Cubase wasn't really working out for me anyway.

So all my previous work is lost, all that remains is the mp3 versions, and I'm now embarking on a new journey with a new sequencer and hoping things will turn out better this time.  Maybe this time I will make a proper regular offsite backup instead of relying on luck or a RAID 1 array to protect me.  Feeling a bit depressed about everything right now.
Title: Re: What are you working on? :D
Post by: Bonobo on July 23, 2011, 08:32:14 AM
Oh sh!t, that’s bad, you have my sympathy.
Title: Re: What are you working on? :D
Post by: Aino on July 30, 2011, 08:56:39 PM
So anyone working on something awesome? :D

I'm bored... So I'm just wondering :P
Title: Re: What are you working on? :D
Post by: AWS on July 31, 2011, 07:07:18 AM
HAIL!!
finally, im getting back into making a level.

im using Roid forge to see what kind of resutls i can achieve with that.
ive incorporated hitman's rallysystem but am having trouble getting it to work outside of the test map it came with.. not sure why its not working in mine.

next is to add some devilish AI.
then testing begins...

 ;D



Ha, this made me happy to read this. Friend me on steam with hits271 or just send a message on this forum for rallysystem troubleshooting.

Make sure you paste whatever is included in the RallyModeStart to RallyModeEnd comments in the beta level code. I'm going to upload an easier to implement version by the end of today

het HM...
PM'd you about my probs with incoproating your code..
ive added the Infected AI, and once we can figure out the rally stuff (ive been gagging to get a rally system into my maps ever since pilchard first made his first code), the map will be good to beta test...
aino's also suggested something interesting to add to it so i hope you can help me with that too, mr aino..!? 8)

looking forward to getting this map finished with all the things  i want in it... once i can have all the things i want in a level ill be able to make a few more a little more quickly than usual  ;D ;D ;D

aws
Title: Re: What are you working on? :D
Post by: Aino on July 31, 2011, 07:54:22 PM
Hmmm, I wonder if...

Is it possible to get the neighbours of an asteroid by getting it from the game itslef? That should be possible, and I do belive there is a neighbouring system used by the game istself. I'm just mentioning, would be much more resource friendly :)
Title: Re: What are you working on? :D
Post by: Pilchard123 on July 31, 2011, 09:28:51 PM
Set up a lookup table at the start, if you have no gravity. Use Asteroid.Reachable.
Title: Re: What are you working on? :D
Post by: Aino on July 31, 2011, 09:34:46 PM
I have a custom made lookup table, yes... But I wondered if the game's neighbouring system thing is reachable for us! Since the AI works fine with gravity and changed asteroid positions, it is updated frequently I guess!
Title: Re: What are you working on? :D
Post by: annikk.exe on July 31, 2011, 11:08:18 PM
I am working on Spacechem.
It's a very hard indie puzzle game.

Today I completed a level called Omega Pseudoethylene.  Here is a screenshot of the harder of the two reactors:

click (http://img811.imageshack.us/img811/1598/omegapseudoethylene.png)

That was not trivial to make.


Now I am on the final level, which apparently puts me in the top 3% of players.  Less than 1% of people who play SpaceChem actually go on to complete the final level.
Title: Re: What are you working on? :D
Post by: Aino on July 31, 2011, 11:12:23 PM
Uhh, does not compute?

I don't understand a thing xD
Title: Re: What are you working on? :D
Post by: annikk.exe on July 31, 2011, 11:30:43 PM
Here (http://store.zachtronicsindustries.com/product/spacechem) is a demo.  Links are on the right.
Title: Re: What are you working on? :D
Post by: Pilchard123 on August 01, 2011, 01:08:13 AM
^^^^There is some epic. ZI makes some good stuff.
Title: Re: What are you working on? :D
Post by: Sniped50 on August 01, 2011, 01:19:10 AM
Oh god, the last level! I'm very frustrated at the moment because I pride myself with the fact that I'm very good at solving logic/engineering puzzles, and then THAT comes along... >:(

I've been at it for months and I still can't work it out. Maybe you'll have better luck annikk...

PS: If you've got ResearchNet on there (SpaceChem's version of a level editor), look at Volume 1 Issue 7. One of my puzzles is on there!
Title: Re: What are you working on? :D
Post by: annikk.exe on August 01, 2011, 01:21:09 AM
I'm not doing anything from research net until I figure out the final level.

Making laz0r fuel looks tricky, the rest looks ok.
Title: Re: What are you working on? :D
Post by: Aino on August 01, 2011, 09:20:01 AM
Guys, I've made a new AI! Finally I've solved the problem with AI's, it got a new smart assault method and is cautious not to lose many seedlings in any case! This might be a flaw or not, but thats how it is built! The last thing to add is flower planting :)
Title: Re: What are you working on? :D
Post by: Aino on August 01, 2011, 09:46:23 AM
Ok, done!

I then name it Merchant AI, it damn furious and cautious! Let's see if it can defeat the Infected, in the "AI battleground" (a map, totally symetrical of every thig, meaning both AI's personality/performance is the only thing counting!
Title: Re: What are you working on? :D
Post by: Aino on August 01, 2011, 10:10:42 AM
There must be something wrong with my AI... or the map!

It's defeating the Infected AI D:

And in matter of fact: there was a malfunction in the attack system that i hadn't seen, though it didn't cause any engine failure, so it is hard to see then!

Annikk, wanna improve ur AI now? : D
If so, my work here is done :)
Title: Re: What are you working on? :D
Post by: Aino on August 01, 2011, 10:24:15 AM
Awww, fixed it... but now Infected wins o.O

But I know the reason, Infected is a ninja :P
Right after My AI captured an asteroid, it swarmed the weak point(newly captured asteroid) and gained control of it! Now it was leading and hvaing a huge army since mine has lost alot from the battle!

But! I've made a new AI, I'll match it against Alien nao, let's see if V1 beats V4(yes, it really is!) :P

Edit: The Merchant died, I know why! The same reason as before... Lesson leanred: gonna make it need more units before attacking!

Edit 2: Unpredictable reults, for some reason Alien AI act on both sides, making it attack earlier than expected, etc...

Edit 3: Merchant AI vs itself = LOOOOOOOOOOOOOOOOOOOOOOL a.k.a Mirror!

They do exactly the same, in different patterns, but still doing exactly the same!

Gonna release it, it's so simple to implent that your eyes will burn if it is not, copy + paste and then change minimum 1 value(which is which factions it will control!)

Also, the AI can hold up to 50 iterations on a map with 20 roids without getting any lag! Seriously, it's not CPU consumting at all, it's very easy on the system!

Downside of that is that is isn't compatible with moving asteroids, then I reccomend Annikks Infected AI :)
Title: Re: What are you working on? :D
Post by: annikk.exe on August 01, 2011, 03:54:41 PM
Was your AI controlling Infected's asteroids/seedlings?
Title: Re: What are you working on? :D
Post by: Aino on August 01, 2011, 08:50:36 PM
Nope, yours weren't controlling mine either :P

Mine has a way to select individual empires, an array where you just input empire number, it could be {4,6,7,8} or {0,2,3}(yes, this one can control grays if you want it to :P) :)

I haven't tested since after I added more units to attack with though, maybe see now!
Title: Re: What are you working on? :D
Post by: Aino on August 01, 2011, 08:58:26 PM
Annikk, I'm sorry to say: Yours just got PWN'd... Although I played at faster speed, cause I'm tired of watching such a slow show :/

Added the file as an attachement here if anyone wanna see the fight! I might have predicted wrong if you play at normal speed(Mine checks 50 asteroid 60 times a second, or 3000 asteroids a second! So it might have been that mine react much faster!)
Title: Re: What are you working on? :D
Post by: annikk.exe on August 01, 2011, 09:34:28 PM
Infected AI will perform extremely poorly or not at all if the game speed is increased using Developer Mode.  So I am not surprised at the result.

I will run a test now and see what happens at normal speed.  :>
Title: Re: What are you working on? :D
Post by: annikk.exe on August 01, 2011, 09:40:13 PM
edit, nm
Title: Re: What are you working on? :D
Post by: annikk.exe on August 01, 2011, 09:43:28 PM
Running at normal speed, IAI wins.  Sorry dude.. :>
Title: Re: What are you working on? :D
Post by: Aino on August 01, 2011, 09:58:27 PM
I'm OK with that :P

Atleast I hope it gives it a challenge?

I'm making a map now though, releasing my AI(even though it exists out here on the forum already!)
Title: Re: What are you working on? :D
Post by: annikk.exe on August 01, 2011, 10:27:05 PM
The differences are visible right from the start, your AI sends all seedlings to one asteroid, plants on it, then sends the rest to a second asteroid.  Mine splits its force equally between two asteroids, sending 50% to each at the same time.  Consequently, my AI gets its trees planted earlier than yours.

However yours gets its 5th up sooner than mine.  And its 6th.

Your AI seems to send ALL reinforcements for new tree planting, instantly.  My AI makes each asteroid wait until it has 10 seedlings before sending them to colonise stuff.

My AI gets its 7th asteroid about 20 seconds ahead of yours.  Your AI gets its 8th asteroid about 20 seconds ahead of mine.

As soon as your AI has captured its 8th asteroid, it instantly starts sending seeds to attack the player asteroids.  It actually sends a whole bunch of them to their death, they arrive one by one.  Then it seems to stop attacking and waits for a while.  Meanwhile IAI is massing up a huge force..

After a couple minutes, IAI has massed up a large force and attacks the north player asteroid.  Meanwhile, your AI attacks the sound player asteroid.  IAI captures north, your AI captures south a few seconds later.

No sooner has your AI captured the south player asteroid, than IAI attacks one of your asteroids.  Your AI responds by attacking one of IAI's asteroids.
IAI captures your asteroid, then rushes back to defend the attack.  It is not fast enough and IAI's asteroid falls to your AI.

Many battles ensue.  Quite fun to watch this really.. :>

Title: Re: What are you working on? :D
Post by: annikk.exe on August 01, 2011, 10:27:44 PM
By the way Aino, did I hear you mention something about GetFactionColour the other day?  What is that?  How does it work?
Title: Re: What are you working on? :D
Post by: Aino on August 01, 2011, 10:32:32 PM
Heh, the battles gets huge in the end :P

GetFactionColour(faction,something) is to GET the colour of a faction, meaning you can make sprites with the colour of a faction. I don't know what "something" is for, but use 2 there and then when you want a specific colour, do GetFactionColour(faction,2).r/g/b :)

And don't thank me for this, thank Mihhaelo for the whole thing. I just mentioned it more often I guess.
Title: Re: What are you working on? :D
Post by: annikk.exe on August 01, 2011, 10:38:50 PM
That's AWESOME.

That means you could make an empire colour selector!!
And thus build maps where the enemy is always a starkly different colour to the player!!
Title: Re: What are you working on? :D
Post by: Aino on August 01, 2011, 10:40:48 PM
Hmm, you can try :P

Haven't experiemented with Setting colours, I've just been Getting colours :)

Good Luck :)

BTW: The starfield ain't checking asteroid on the map I have :/

Any reason for that?
Title: Re: What are you working on? :D
Post by: annikk.exe on August 01, 2011, 10:42:18 PM
Great job on this AI by the way, this is your best AI to date for sure.  It's giving IAI a run for its money.. :>

One of these days you are going to produce an AI that can beat IAI.  There are inefficiencies in the IAI code, and not-so-smart reactions that it does...  If you programmed an AI that colonises and attacks efficiently to maximise its swarm as fast as possible, coupled with some routines specifically designed to take advantage of weaknesses in IAI, I have no doubt you would be successful in defeating it.


But for now, IAI v2.3 remains the deadliest AI for Eufloria... :>
Title: Re: What are you working on? :D
Post by: annikk.exe on August 01, 2011, 10:45:05 PM
Well you can test what GetFaction(1,2).r is, then test if GetFaction(2,2).r is nearby this value... if they are similar, test empire 3 instead.  Keep going until you find a markedly different value... lets say you discover empire 5 has a much different colour... then you simply make the enemy as Empire 5.  Voila; automatic contrasting empire colours.  :>

Quote
BTW: The starfield ain't checking asteroid on the map I have :/

Any reason for that?

What are you trying to do?
What is going wrong?
Title: Re: What are you working on? :D
Post by: Aino on August 01, 2011, 10:50:26 PM
Uhhmm, I'm making my map, I haven't changed very much of it(especially not the core(engine)) but it won't hide stars behind the asteroids on the map.Though I'm using ScreenDraw() version, not LevelDraw()!

Should I PM you the map? It's pretty long, thanks to my Map Editor >.< (it's useful though :))
Title: Re: What are you working on? :D
Post by: annikk.exe on August 01, 2011, 10:51:11 PM
By the way, your AI is managing to plant trees on asteroids owned by my AI...  I had that bug with my AI for a while but it seems like it's yours doing it now?  Not sure...


For the Starfield engine, make sure you are declaring the number of asteroids.  Make sure the engine is being run in a loop.  Etc.  :>
Yeah PM it if you can't fix it on your own.
Title: Re: What are you working on? :D
Post by: Aino on August 01, 2011, 10:56:10 PM
Wait... is it planting on and asteroid that is not barren? o.O
It should be able to plant on an enemy asteroid aslong as there are no roots! Else, it must own it itself! Look at the code, it's clearly stated inside. I'll have to take a look now though :)

I'll see if I can fix the problems, but what do you mean by setting the amount of asteroids? And it's running in a loop, else it wouldn't show up at all :P
Title: Re: What are you working on? :D
Post by: Aino on August 01, 2011, 10:57:55 PM
I figured out by thinking, I decleared it before setting the asteroids(init)! Derp...
Title: Re: What are you working on? :D
Post by: Aino on August 01, 2011, 11:02:55 PM
Works now :)

Soon this map will be released... Need some beta testers first though o.O
Title: Re: What are you working on? :D
Post by: annikk.exe on August 02, 2011, 12:03:03 AM
I've thrown together a more natural, organic level for the AI's to fight on.  :>

This is a better test of things like choice of asteroids to conquer.. :>  It's not so linear, so the AI's have the potential to make decisions about which asteroid is nicest and colonise that one first.

Aino, have you tried making one of the stars move? :>  Have you tried making it come up in front of the asteroids, and close to the camera?  Awesome effects possible that way, maybe nice for an intro or somesuch.. :>
Title: Re: What are you working on? :D
Post by: Aino on August 02, 2011, 12:11:27 AM
I use the come into the screen thing(it's awesome!), but IDK how to make stars move D:

BTW, my AI doesn't pay attantion to attribs yet D:

Gonna make 'em! V 1.01 coming up then I guess :)
Title: Re: What are you working on? :D
Post by: Aino on August 02, 2011, 12:48:39 AM
Mehh, I'll do it once I find a proper and good way to do it. I really want it, but I don't want to ruin the AI D:
Title: Re: What are you working on? :D
Post by: Pilchard123 on August 02, 2011, 02:30:40 AM
EDIT2: Removed complaints. Thank you Aino.

EDIT1: Also, thinking of writing my own AI sometime soon. I really want to get back into the Eufluaria stuff, but I have quite a few commitments atm. My early-summer job contract runs out this week though, mixed feelings about that. Stupid college essay is less work now, only 1500 words, rather than 5000, provided I produce an 'artefact' to go with it. Programs are acceptable, so I'm self-teaching Java. My li'l brother wants me to teach him to use Unity and/or Java. So much for a holiday.
Title: Re: What are you working on? :D
Post by: annikk.exe on August 02, 2011, 03:03:53 AM
Ok, did a more awesome version.  Attached.  Also edited my previous post to remove the old version, so there's no confusion.

The starting positions are random; sometimes Infected will start at the top, sometimes it will start at the bottom.

Aino, here is my challenge for you.  If you can make your AI win on this level from BOTH starting positions, and played out at normal speed, I will concede it is better than Infected.... and make an Infected AI v3.  :P
Title: Re: What are you working on? :D
Post by: Aino on August 02, 2011, 03:10:01 AM
Which word? I removed the swear :)
Title: Re: What are you working on? :D
Post by: annikk.exe on August 02, 2011, 03:13:54 AM
I use the come into the screen thing(it's seeding awesome!), but IDK how to make stars move D:

Ok, what you do is you set a new 3D position for a given star ID.
A star's 3D coordinates are expressed like this:

Code: [Select]
SetStarX[starID] = X coordinate of the star
SetStarY[starID] = Y coordinate of the star
SetStarZ[starID] = Z coordinate (positive is behind asteroids, negative is in front of asteroids)

So supposing you want to make star ID 5 your "dancing" star. :>

Do something like this:

Code: [Select]
SetStarX[5] = math.sin(GetGameTime()) * 500
SetStarZ[5] = math.cos(GetGameTime()) * 500

Just make sure that code is run inside a loop in your function levellogic() and now star ID 5 will be moving in a circle left/right and toward/away from you.  :>
Give it a try man - I'm sure you'll be able to see the possibilities.. :>


Quote
BTW, my AI doesn't pay attantion to attribs yet D:

Gonna make 'em! V 1.01 coming up then I guess :)

Neither does Infected AI.. :>  So if you successfully implement colonisation priorities according to asteroid stats, that's a new weapon your AI will have over Infected.. :>
Title: Re: What are you working on? :D
Post by: Aino on August 02, 2011, 03:15:36 AM
Annikk, my AI will never defeat your AI, it has one more action to do than yours, to discover asteroids! This leads to cruecial loss of seedlings for the AI! And is time consuming!

I can do things to make it almost defeat Infected, but I'll never achieve it with that extra duty(which I'll keep) :P
Title: Re: What are you working on? :D
Post by: annikk.exe on August 02, 2011, 03:20:29 AM
Ah right... yeah, Infected automatically sees any neighbouring asteroids without needing to scout them.  The AIs really need to follow the same set of rules for it to be a fair fight.

Is there any easy way to turn your scouting stuff off, just for this purpose?
Title: Re: What are you working on? :D
Post by: Pilchard123 on August 02, 2011, 03:20:50 AM
Which word? I removed the swear :)

Thank you. I really don't like people swearing where it's not necessary. In fact, if you stop and think about it, it rarely is.
Title: Re: What are you working on? :D
Post by: Aino on August 02, 2011, 03:39:45 AM
Annikk, replace this with the ENGINE only!

Code: [Select]
function MAIEngine()

if MAINeighboursSet == false then

if GetGameTime() > MAIGraceTime then

for i = 0,MAINumRoids do

for j = 0,MAINumRoids do

if i ~= j then

local Xd = GetAsteroid(i).position.x-GetAsteroid(j).position.x
local Yd = GetAsteroid(i).position.y-GetAsteroid(j).position.y
local dist = math.sqrt((Xd^2)+(Yd^2))

if dist < GetAsteroid(i).SendDistance+GetAsteroid(j).Radius then

--As a match occours, it will make the asteroid a neighbour so the AI understands it.
MAINumNeighbours[i] = MAINumNeighbours[i] + 1
MAINeighbour[i][MAINumNeighbours[i]] = GetAsteroid(j)

end

end

end

end

MAINeighboursSet = true

end

else

for iteration = 1,MAINumIterations do

local SelRoid = GetAsteroid(math.random(0,MAINumRoids))
local roidid = SelRoid.ID

--SelRoid.Name = "P = "

for CheckedFaction = 1,MAINumFactions do

local faction = MAIFaction[CheckedFaction]

if SelRoid.Owner == faction then

local Tree = SelRoid:GetRandomDysonTree()
local Flower = nil

if Tree ~= nil then

Flower = Tree:GetSuperSeedling()

end

if Flower ~= nil then

Flower:Pluck()

end

local Flower = SelRoid:GetFlower(faction)

if Flower ~= nil then

Flower:PlantOnRandomDysonTree()

end

if SelRoid:GetNumSeedlingsExcluding(faction) > SelRoid:GetNumSeedlings(faction)/4 then

MAIPriority[faction][roidid] = 0

end

if SelRoid:GetNumTrees() < SelRoid.TreeCap and MAIPriority[faction][roidid] > MAINumRoids * 1 then

MAIPriority[faction][roidid] = MAINumRoids * 1

end

if MAIPriority[faction][roidid] == 0 and SelRoid:GetNumSeedlingsExcluding(faction) == 0 then

MAIClearPriority(0,faction)

end

if MAIPriority[faction][roidid] == MAINumRoids * 1 and SelRoid:GetNumTrees() == SelRoid.TreeCap then

MAIClearPriority(1,faction)

end

if MAIPriority[faction][roidid] == MAINumRoids * 3 then

MAIClearPriority(3,faction)

end

if MAIPriority[faction][roidid] ~= 0 and MAIPriority[faction][roidid] ~= MAINumRoids * 1 then

for CheckedNeighbour = 1,MAINumNeighbours[roidid] do

local neighbour = MAINeighbour[roidid][CheckedNeighbour]

if MAIPriority[faction][neighbour.ID] < MAIPriority[faction][roidid] then

MAIPriority[faction][roidid] = MAIPriority[faction][neighbour.ID] + 1

if MAIPriority[faction][neighbour.ID] == MAINumRoids * 1 and neighbour.Owner ~= faction then

if SelRoid:GetNumSeedlings(faction) > neighbour:GetNumSeedlingsExcluding(faction)/1.25 then

SelRoid:SendSeedlingsToTarget(faction,SelRoid:GetNumSeedlings(faction),neighbour)

end

elseif MAIPriority[faction][neighbour.ID] == 0 then

if SelRoid:GetNumSeedlings(faction) > neighbour:GetNumSeedlingsExcluding(faction) then

SelRoid:SendSeedlingsToTarget(faction,SelRoid:GetNumSeedlings(faction),neighbour)

end
else
if MAIPriority[faction][neighbour.ID] ~= MAINumRoids * 3 then

SelRoid:SendSeedlingsToTarget(faction,SelRoid:GetNumSeedlings(faction),neighbour)

end
end

end

end

end

else

if SelRoid:IsBarren() then

if MAIPriority[faction][roidid] > MAINumRoids * 1 then

MAIPriority[faction][roidid] = MAINumRoids * 1

end
else

MAIPriority[faction][roidid] = MAINumRoids * 3

local AssaultArmy = 0

for CheckedNeighbour2 = 1,MAINumNeighbours[roidid] do

local assault_neighbour = MAINeighbour[roidid][CheckedNeighbour2]

if assault_neighbour.Owner == faction then

if MAIPriority[faction][assault_neighbour.ID] > MAINumRoids * 3 then

AssaultArmy = AssaultArmy + assault_neighbour:GetNumSeedlings(faction)

end

end

end

if AssaultArmy > SelRoid:GetNumSeedlingsExcluding(faction) * 2 then

for CheckedNeighbour2 = 1,MAINumNeighbours[roidid] do

if MAINeighbour[roidid][CheckedNeighbour2].Owner == faction then

if MAIPriority[faction][MAINeighbour[roidid][CheckedNeighbour2].ID] > MAINumRoids * 3 then

MAINeighbour[roidid][CheckedNeighbour2]:SendSeedlingsToTarget(faction,MAINeighbour[roidid][CheckedNeighbour2]:GetNumSeedlings(faction),SelRoid)

end
end
end
end
end

end

if MAIPriority[faction][roidid] == MAINumRoids * 1 then

if SelRoid:GetNumSeedlings(faction) >= 10 then

SelRoid:PlantDysonTree(faction)

end

end

-- SelRoid.Name = SelRoid.Name .. MAIPriority[faction][SelRoid.ID] .. "  "
end
end
end
end

and you have it ignore visability I guess! Gonna test :)

But annikk, when I make movements on the star, they appear in the bottom of the starfield D:
Title: Re: What are you working on? :D
Post by: annikk.exe on August 02, 2011, 03:48:34 AM
Quote
But annikk, when I make movements on the star, they appear in the bottom of the starfield D:

Not sure what you mean... Can you screenshot it or explain more or something? :>

I'll try your engine update.
Title: Re: What are you working on? :D
Post by: Aino on August 02, 2011, 04:02:42 AM
The movements and all works, but it just appears at the bottom of the starfield!

So, when I do this:

Code: [Select]
SetStarX[1] = math.cos(GetGameTime()) * 75000
SetStarY[1] = Field + math.sin(GetGameTime()) * 75000
SetStarZ[1] = ((math.cos(GetGameTime()/1000) * math.sin(GetGameTime()/1000))/2) * 500000

I find the star wobbling up and down(Z), but it just sticks to the bottom(+ coords) of the starfield!

Hmm, when I set X and Y to 0,0 it works...
Title: Re: What are you working on? :D
Post by: Aino on August 02, 2011, 05:15:04 AM
Fixed it :D
Title: Re: What are you working on? :D
Post by: annikk.exe on August 02, 2011, 07:53:39 AM
Enjoying ? :>
Title: Re: What are you working on? :D
Post by: annikk.exe on August 02, 2011, 09:07:28 PM
Annikk, replace this with the ENGINE only!

and you have it ignore visability I guess! Gonna test :)

But annikk, when I make movements on the star, they appear in the bottom of the starfield D:

Tested this with your engine update last night, Infected still won... though it's close.  They colonise the galaxy at roughly the same speed, but IAI makes better decisions about when to attack, and is able to attack multiple points at once which gives it a unique advantage.
Title: Re: What are you working on? :D
Post by: Aino on August 02, 2011, 09:10:45 PM
Can you see the new attack method of the Merchants? :)

It's brilliant IMO... And yes, the values for the AI must be changed, you AI don't mind sending 2 seeds to battle where your AI loses 500 v 300, but mine does and gathers up before an attack, though it doesn't count with the existing seedlings of it's faction >.<

I have a lot to fix/polish with my AI, but the ground basics are forged :)
Title: Re: What are you working on? :D
Post by: annikk.exe on August 02, 2011, 09:16:33 PM
Yeah attacks are a lot more effective if a "gather point" asteroid notices an attack is already under way, and doesn't stockpile hundreds of seedlings but rather sends them in a continuous stream to reinforce the attack... as long as it appears to be winning the fight.
Title: Re: What are you working on? :D
Post by: Pilchard123 on August 03, 2011, 04:58:10 AM
Does anyone know how an asteroid is reachable? Is it only reachable if the SendDistance of the sending 'roid hits the center of the recieving, or does it only have to touch the edge?

Also, we need less stickies.
Title: Re: What are you working on? :D
Post by: Aino on August 03, 2011, 05:21:15 AM
Waht U mean?
Title: Re: What are you working on? :D
Post by: Aino on August 03, 2011, 05:27:22 AM
I wanna make a game, in C++ or C# or java for that sake :S

I just don't know how to build up the drawing engine x.x
Title: Re: What are you working on? :D
Post by: Pilchard123 on August 03, 2011, 05:30:12 AM
Look at the Oracle java tuts. I'm fairly sure I saw a graphics one in there somewhere. You could use Unity, that's partly C#.

Also, never mind about my previous post.
Title: Re: What are you working on? :D
Post by: Aino on August 03, 2011, 06:03:33 AM
Hmmm, Oracle's java tuts are terribly long D:

I tried to read it once(unless I've read something you didn't) and it started with 3 pages(I believe) just explaining why java is good to use and the upsides with it... I wasn't very happy for that to be the first impression and then went to  YouTube, seeing a guy called TheNewBoston making java tuts, I was overly happy and did everything he told(without that time spent I wouldn't have made and AI, DrawText() or GetMouseX/Y()!), but ended up beeing so boring doing all the coding in the end. I wanted to do something more immediat(or do some results) and ended up here, seeing all the posabilities! I started up, doing the map Rings, with a customised normal AI and some cool functions like screen flashing red when attacked. It was pretty basic and everything. I got my attention at Annikk's AI and wanted to write my own, so I started up, I believe I asked many questions to him and you guys just to finish Alien AI! The outcome was better than my hopes, but had a bug with priorities wobbling around, ending up with sending seedlings from one asteroid back to where they come from a long time, untill they hit a priority which would reset them! I fixed that later though! Also, in the meantime of making the AI, taking a slight break from all the problems with moving seedlings and planting trees I made the map Risks, where you couldn't plant trees and captured asteroids by being the single leader of it and gaining seedlings every 4th second! After I finished the AI I did many things, my imagination overloaded! Untill I hit a conversation about a mayor asteroids with small "orbiters". I was imaginating what the outcome was, Solar Conquest. Which I loved dearly(I do that to all of my prj. :P), but actually I never finished the map myself! I got a little tired of the theme "Eufloria" and played alot of other games, among them is Osmos, I began coding a map with moving balls and where you can click to move your own, the basics of Tough Collisions were set. Now I added collision with other balls, colours and everything else you see on the map, I updated the map quite alot(I won't stop either I guess, just need something to add :P) and ended up with nothing more to add! After this I got crazy about AI's again, I made test chambers for AI wars(Alien vs Infected) and ended up with the squarelike map "Square"! I tested Alein vs Normal vs infected (vs player). I released it to the forum, 'cause I guessed other people might enjoy competing or watching them crush eachother! So then, when I saw Infected defeating Alien with no struggle, I wanted to make a new and better AI. Days of struggle, trying to make a new! But all of them failed, I learned alot though. I ended up updating the old Alien AI and made it more careful about stats, priorities and other stuff. Now I tested it, but it didn't win! I didn't bother now, I wanted to make a new map, so I made "The Broken Belt" which I liked alot, since it wasn't so random or simple, it was complex and the same! Nothing changed, NOTHING! It was a release candidate for my new updated AI, so I released it. Then after that I began getting interested in campaign, so I started creating what is now Adventure(NOT RELEASED!) and finished it, though the campaign maps aren't there yet. After that again, I got interested in making an in-game editor, Annikk made one before me(I abondoned the project!) and released AsteroidDesigner, I began edit it like cray, because Annikk made the foundation of a map editor, so I had something to work with! Annikk later released RoidForge, which I liked alot, the display was much cleaner and nicer and I decided to make my own! I ended up taking all of the things you can change(simply) with an asteroid and made it into an editor, released it with a stupid name: RingDesigner! Then I made a new AI, Merchant AI, and with it I made Ring or Corruption! I guess you read the whole thing o.O!




*me thinking after written all of this*: Why did I write that?*end*

Well, thats my story on the forum o.O
Title: Re: What are you working on? :D
Post by: Aino on August 03, 2011, 06:17:57 AM
Trying to learn Unity :)
Title: Re: What are you working on? :D
Post by: annikk.exe on August 03, 2011, 09:29:57 AM
Just completed SpaceChem.  :>

It took me all evening to complete the last level.  Once I had my solution, it took me about 50 attempts to actually kill the enemy ship, heh.
Title: Re: What are you working on? :D
Post by: annikk.exe on August 03, 2011, 09:32:44 AM
Does anyone know how an asteroid is reachable? Is it only reachable if the SendDistance of the sending 'roid hits the center of the recieving, or does it only have to touch the edge

Asteroid A can reach Asteroid B if Asteroid A's Send Distance is greater than the distance from the center of asteroid A to center of asteroid B minus Asteroid B's radius.

In other words, it's the distance from the center of the sending asteroid, to the edge of the destination asteroid.

Quote
Also, we need less stickies.

Yes.
Title: Re: What are you working on? :D
Post by: Aino on August 03, 2011, 09:38:53 AM
Nice! I guess the game is pretty good then, still haven't tried it :S
Title: Re: What are you working on? :D
Post by: annikk.exe on August 03, 2011, 09:42:09 AM
You should check out the demo at least... :>  It's really worth your time man.  I think you would be good at it as well, you have the right sort of mind for it.. :>
Title: Re: What are you working on? :D
Post by: Aino on August 03, 2011, 09:44:30 AM
Heh :P

I'm currently working on "The game" *insert trollface* "Bounce", which has already taken shape, the last things to add is small bonuses and downsides(temp effects)
Title: Re: What are you working on? :D
Post by: Aino on August 03, 2011, 09:57:40 AM
What is the Opposite of Bonus Called?
Title: Re: What are you working on? :D
Post by: Alex on August 03, 2011, 11:01:29 PM
Just completed SpaceChem.  :>

I have been playing that recently. It is an amazing game!
Title: Re: What are you working on? :D
Post by: Bonobo on August 04, 2011, 02:37:45 AM
What is the Opposite of Bonus Called?
Malus
Title: Re: What are you working on? :D
Post by: Pilchard123 on August 04, 2011, 02:50:53 AM
Trying to learn Unity :)

Try http://www.unity3dstudent.com . It's really good, though he does use UnityScript, not C#. It would be fairly easy to convert, and it doesn't matter which you use anyway - it all gets converted to a standardised language at compile anyway.
Title: Re: What are you working on? :D
Post by: annikk.exe on August 04, 2011, 05:31:05 AM
I will be away until Sunday evening.  Access to the forums will be sporadic at best and I probably won't post much since I'll be reading the forums on my phone.
Title: Re: What are you working on? :D
Post by: Pilchard123 on August 04, 2011, 05:38:08 AM
Goin' to Abu Dhabi, are ye?
Title: Re: What are you working on? :D
Post by: Aino on August 04, 2011, 05:54:23 AM
Good luck on the trip to where ever you are going :)



I'll try myself on Voxel Rendering, it's pretty awesome :)
Title: Re: What are you working on? :D
Post by: annikk.exe on August 04, 2011, 08:00:26 AM
Goin' to Abu Dhabi, are ye?
Not this time.. This (long) weekend I shall be attending a wedding at a mansion in the cottswolds that used to belong to riddley scott. It will be quite insane.

I am far from home!
Title: Re: What are you working on? :D
Post by: Aino on August 04, 2011, 08:07:30 AM
A wedding? GL :)
Title: Re: What are you working on? :D
Post by: Pilchard123 on August 05, 2011, 02:52:49 AM
Do any of the currently released Lua AIs use anything that is not known or could not be known by a human playing the game normally? AI-specific variables don't count here, such as IAI's metrics.

EDIT: Also, do they know which AI an opponent is using?
Title: Re: What are you working on? :D
Post by: Aino on August 05, 2011, 03:15:44 AM
What do you mean?
Title: Re: What are you working on? :D
Post by: Pilchard123 on August 05, 2011, 03:28:36 AM
I mean - do the IAI, AAI or MAI use data that could not be learned by a human playing the game? The human would not be using the console, devmode, or other 'non-game' tools.
Title: Re: What are you working on? :D
Post by: Aino on August 05, 2011, 03:32:11 AM
As far as I know, they don't. They use everything a< huamn can, but not more :P
Title: Re: What are you working on? :D
Post by: Bonobo on August 05, 2011, 05:15:17 AM
What about asteroids … was it not so that some AIs don’t have to explore b/c they already “know” about them?
Title: Re: What are you working on? :D
Post by: Aino on August 05, 2011, 05:41:30 AM
Infected AI knows about the asteroids properties and stuff before it has explored it, but Alien/Merchant follows the game rules :)
Title: Re: What are you working on? :D
Post by: annikk.exe on August 06, 2011, 01:09:52 AM
IAI is only "aware" of asteroids that are within send distance of the asteroids IAI owns. So it can't see anything that happens at the back of your empire, for example.

It seems like people would prefer that the standard be that AIs follow the same rules as players must follow with regard to intelligence gathering/scouting so I will aim to make IAI comply with those rules for version 3.

The place I am in is totally crazy. Hard to explain but I shall produce pics upon my return :>
Title: Re: What are you working on? :D
Post by: Aino on August 06, 2011, 02:04:04 AM
So IAI can only see what is happening on their own asteroids? Not on any "invisble" ones?
Title: Re: What are you working on? :D
Post by: annikk.exe on August 06, 2011, 02:08:59 AM
No.. On it's own asteroids AND neighbouring asteroids
Title: Re: What are you working on? :D
Post by: Aino on August 06, 2011, 02:48:39 AM
So, what you mean is taht it sees every asteroid on the map? Only that they see it via neighbours, but in theory they then see the whole map :P
Title: Re: What are you working on? :D
Post by: Pilchard123 on August 06, 2011, 03:18:40 AM
I don't mind AIs being able to do things people can't, it's one of the advantages they have to counter not being human. I was just wondering if there was anything that was avoided for the sake of fairness in an AI.

Aino - Yes, the IAI could see every asteroid on a map, but only if it can reach them. Asteroids that it can't reach are invisible to it. Also, why Merchant? Alien and Infected I understand, but Merchant seems like a...merchant, really.
Title: Re: What are you working on? :D
Post by: Aino on August 06, 2011, 03:53:52 AM
Waht u meen? The name?

Well, I was empty of ideas, the AI is brutal and the name popped into my head all the time D:
Title: Re: What are you working on? :D
Post by: Lost Seedling on August 06, 2011, 11:11:28 AM
Wait a minute. The goal of the AI creator in a game against a human opponent should be to maximize the enjoyment of the player in the game experience, not demonstrate their coding prowess in creating an unbeatable opponent. Anyone who has played a FPS knows how frustrating it is having computer opponents with inhuman aim or super-hearing. It detracts from the game experience. The best AI give the player a challenge without being overwhelming. That's why they come with settings- so you can adjust the AI suitable to your skill level.

Now if the goal is to demonstrate an AI that can beat a human, such as Deep Blue or Watson, then you want to make the AI as smart as possible by any means. A brute-strength opponent such as Deep Blue had the advantage of never getting tired, plus the programmers were able to study Kasparov's past tactics, whereas Kasparov had no such ability to study Deep Blue. It may have "followed the rules", but it was not a fair match, even though it demonstrated the advances in computer speeds. In the case of Watson, the challenge to the programmers covered a much wider array of obstacles. Nevertheless, they still had to accommodate the human players- for instance- Watson could theoretically buzz in much quicker electronically, so they had to make an artificial delay in his response time.

In the case of Annikk's Infected, it has the advantage of being able to move seedlings much quicker than a human can maneuver the mouse and click. However, it is still possible to beat it under certain conditions because it can not yet make judgements on asteroid attributes nor make strategic decisions map-wide like a human can on "organic" layouts, for example.

To imply that Infected or any other AI is "cheating" or is "unfair" would be missing the point of the whole idea. The goal is to make a computer opponent which can best deliver an enjoyable gaming experience, regardless of how it does so. If, by using techniques or information beyond the players ability to overcome, it cannot be beat, then it serves no purpose other than as a mechanical exercise. Of course, in the event such an AI is developed, the map creator can always make adjustments in the starting conditions to balance out any advantage held by the AI.

Personally, I find it extremely entertaining and interesting to watch AI operate in any environment, whether it is a DARPA competition or Eufloria. I would love to see a contest between Infected, Merchant, and any other AI competing on a series of maps with different attributes, and then crowning a winner until the next, better, AI comes along. If the contestants would like me to, I'd be glad to do so, document the results, and post the results in it's own thread. What about it? We could have a "map of the week" series of matchups.

I haven't heard anyone say Infected is "unfair", but if they do they really need to examine the whole purpose behind it's existence!!!
Title: Re: What are you working on? :D
Post by: annikk.exe on August 06, 2011, 08:49:27 PM
For me, IAI is supposed to be as deadly as is possible by any means, even if the actions it takes could not be performed so quickly by a human. In that sense it's a mechanical exercise more than an attempt to create a fun-and-fallible opponent. Making ai less difficult in a convincing way is a totally different (and often much harder) task.

I don't believe we are anywhere close to a "perfect" ai yet. The basics are down but there are still a lot of things such as prioritising high-stat asteroids and strategically useful asteroids which I haven't even attempted yet. There is still a lot of work to do in that regard.

I recently made a level that sees aino's latest ai battling against IAI, but the map was heavily balanced in favour of whoever starts in the south.
It would be useful to have a stockpile of good testing maps, both organic and non-organic, to test new ai changes on. That would allow AI programmers to test whether their changes are effective more easily.  Making a balanced organic map is actually quite hard so in the one I made, I had the ai starting positions swap at random on level load. So half the time iai starts in the north, and the other half of the time it starts in the south. That let's you figure out more easily if one of the starting positions offers an advantage over the other.
Title: Re: What are you working on? :D
Post by: annikk.exe on August 06, 2011, 08:52:29 PM
Also, I have heard lots of people say IAI is unfair! Heh
Title: Re: What are you working on? :D
Post by: Pilchard123 on August 06, 2011, 09:24:30 PM
I am actually trying to produce a method of determining strategically important asteroids atm, based on stats, how many other aseroids it can reach, and how many it can be reached by. Stats are fairly self-explanatory, but the send/recieve thing is related to its defensibility and use in offence. If it can send to lots of asteroids, it can attack lots of asteroids and be evacuated easily. It it can't be reached easily, defense can be managed easier, but can't be reinforced well.
Title: Re: What are you working on? :D
Post by: Lost Seedling on August 06, 2011, 10:09:57 PM
Right! Infected has to be as aggressive as possible owing to the current advantages enjoyed by the human player's superior spacial recognition and analytical  abilities on organically layed-out maps. On an evenly populated grid map, however, AI's ability to expand more rapidly owing to the time-advantage in not having to point and click would be extremely difficult to overcome. It becomes a simple mathematical equation.

Pilchard's observation on strategically-placed and statistically important asteroids is dramatically illustrated in Annikk's AI war map. You can watch how certain dead-ends and choke points become critical game-changers. Once control is firmly established there, the enemy is finished. This is obvious to any war-fighter, or game-player from Chess to Go to I guess even Monopoly, but it will be a challenge to design an AI that can duplicate this logic.

While watching AI wars, I also began wondering about the value of determining an asteroid's connectibility in designing a smarter AI. Much like Google's initial revolutionary algorithm (at the time) in determining a site's search relevancy based on the number of links pointing to it, the attractiveness of owning an asteroid by the AI might be determined in part by the same idea. It's an interesting problem, because there are so many variables involved it can't be easily defined. As you say, Pilchard, only those asteroids that can send easily but not be reached easily would be the best candidates. Once you can gain control of a corner of the asteroid field or a chain of asteroids, you can minimize your vulnerability and use all your resources to supply the front. I'll be anxious to see what you come up with!
Title: Re: What are you working on? :D
Post by: Pilchard123 on August 07, 2011, 02:51:16 AM
Right, so far the (as yet unnamed) AI is planned to do the following:



Whether any of those will work remains to be seen.

EDIT: Are tables/matrices very inefficient?
Title: Re: What are you working on? :D
Post by: Sniped50 on August 07, 2011, 04:32:33 AM
@Pilchard

I'd have said it depends on the data you're inputing. If you have a lot of stuff that needs storing, or the axes of the table are dependent on map conditions (for instance, individual rows are seperate asteroid ID numbers), then most likely yes. What I DO know is that if you have a matrix in which most of the slots are going to be left blank, then it becomes very inefficient.

I'm not annikk though. And I've been known to get things wrong before...  :(
Title: Re: What are you working on? :D
Post by: Pilchard123 on August 07, 2011, 04:42:01 AM
According to the Lua reference, sparse tables are quite good, though it only mentions memory efficiency, so I don't know about read speed.
http://www.lua.org/pil/11.2.html

And they are all roidID indexed, though most should only change value every now and then.
Title: Re: What are you working on? :D
Post by: annikk.exe on August 07, 2011, 06:05:18 AM
The number one thing that causes a lot of lag is loops within loops.
Eg:
For each asteroid
Compare to all other asteroids


Loops within loops are somewhat inevitable though, unless you build an ai that precalculates all the relationships during levelsetup and stores the data in a series of matrices.. But that is not a trivial thing to do, and means the ai can't cope with moving asteroids.

The number one challenge in building a deadly ai is identifying generalised circumstances with generalised responses.  Once you know what the ai ought to do in a given circumstance, you can build your rules so it responds appropriately to that situation.

For example, imagine the ai starts with a single asteroid, with 2/4 trees, 50 seedlings, and two nearby asteroids - one with good stats and 3 neighbouring unknown asteroids, the other with average stats and 2 neighbouring asteroids.
What is the optimal opening actions for the ai to take?
Title: Re: What are you working on? :D
Post by: Aino on August 07, 2011, 07:22:09 AM
I have made that pre defined loop thing, and it's much more efficient with resources than my previous one, but you should do a variable "IsMoving" or something, true/false if the asteroid ont he map moves, if so: use the check while playing and if not use the pre defined matrices :)
Title: Re: What are you working on? :D
Post by: Pilchard123 on August 07, 2011, 04:05:12 PM
Did anyone work out how to get hold of the game's reachability data? it would be really useful, though I can work without it.
Title: Re: What are you working on? :D
Post by: Aino on August 07, 2011, 08:43:44 PM
I think you'll need to work without it :/
Title: Re: What are you working on? :D
Post by: annikk.exe on August 07, 2011, 09:37:47 PM
Personally I've always just calculated it myself based on asteroid positions, radiuses and send distances.

I'm enjoying our discussions on ai a great deal. :>
Title: Re: What are you working on? :D
Post by: Aino on August 07, 2011, 10:10:19 PM
I think I'll improve my AI to depend on alot of stuff to do actions, but first I'm going for a vacation tommorow(7 days) and I wanna re-learn all the java things, as last time(when I didn't know anything about coding), it looked like some alien text to me xD
Title: Re: What are you working on? :D
Post by: annikk.exe on August 08, 2011, 06:34:41 AM
I arrived home this evening and watched a documentary about maths.  I had some inspiration of how I might be able to create complex landscapes using the 3D engine I've been working on, potentially providing a rich environment to explore.
Title: Re: What are you working on? :D
Post by: Sniped50 on August 08, 2011, 06:42:24 AM
Really? Do tell us more, annikk! I'd love to see that.
Title: Re: What are you working on? :D
Post by: annikk.exe on August 08, 2011, 08:22:49 AM
Well the basic idea is that if I build a simple landscape out of, say, 100 triangles... and then perform a series of recurring rules on the triangles, EG, split into 3 more triangles per triangle, and move the centrepoint up or down perpendicular to the face by a random amount, it morphs into a crazy landscape.
I need to actually finish the engine first though, I am still wrestling with the concept of pseudo-vertices for now.
Title: Re: What are you working on? :D
Post by: Pilchard123 on August 08, 2011, 05:00:50 PM
Sounds a bit like a deformed version of the Koch snowflake, or possibly Serpienski's triangle
Title: Re: What are you working on? :D
Post by: annikk.exe on August 08, 2011, 07:48:25 PM
Yup what I have described is basically a fractal algorithm.
Title: Re: What are you working on? :D
Post by: AWS on August 11, 2011, 01:18:32 AM
well/... aside from fractal vertices and pythagoras... i have a new little level for people to test if theyre feeling keen?! ;D ;D ;D

its not difficult by any means. in fact, i kinda like it because its a return to how it 'used to be' when i first discovered the game. not difficult, but not super easy. the emphasis being on the exploration and expansion as much as on fighting and winning.
having said that, its a short level so i hope others who dont want a 3hr slog can hop in and enjoy with ease.

anyone???
\aws
Title: Re: What are you working on? :D
Post by: Lost Seedling on August 11, 2011, 02:42:27 AM
I'll test it, of course!
Title: Re: What are you working on? :D
Post by: Pilchard123 on August 15, 2011, 10:01:09 PM
Aino, have you any way of testing the speed that your AIs run? I've had an idea for speeding them up...
Title: Re: What are you working on? :D
Post by: Aino on August 15, 2011, 10:04:33 PM
Mine is very fast :)

60*Number of iterations per second, the amount of iterations is default 10, but mine survives 50 without lag :P
This is mainly because of the pre-set neighbours :P
Title: Re: What are you working on? :D
Post by: Aino on August 15, 2011, 10:37:56 PM
I know what I wanna do!

Make two "circles" then make them scan if the touch eachother, I'll add a lua file soon to show what I mean :)
Title: Re: What are you working on? :D
Post by: annikk.exe on August 16, 2011, 02:44:31 AM
If the distance between their centres (pythagoras) is greater than the sum of their radiuses (just add them), they are not touching.  :>
Title: Re: What are you working on? :D
Post by: Aino on August 16, 2011, 03:21:09 AM
No, thats not what I've been making, I made a "planet"(to explain it simply) with one orbiting "asteroid", when two planets asteroids collide, they'll merge into one, and then, when they shouln't be colliding(the orbits aren't colliding) they separate. If you still don't understand, I'll show in the upcoming file :)

Though, I'm watching 2 1/2 men, so it'll take a little while :P
Title: Re: What are you working on? :D
Post by: Pilchard123 on August 16, 2011, 06:21:40 AM
I just realised why my AI was exploring so well after only one time writing the explore code...

NONE OF MY CODE WAS RUNNING! IT WAS ALL THE BASIC AI!

...

...

...

...

...

I may be scavenging other AI codes.
Title: Re: What are you working on? :D
Post by: Aino on August 16, 2011, 06:33:06 AM
Need help? Ask if you want :)
Title: Re: What are you working on? :D
Post by: annikk.exe on August 16, 2011, 04:01:58 PM
Bummer dude.  Need to set the grace timer to 99999 for all asteroids or something.  :>  Otherwise it's impossible to see if your AI is doing anything.


My overall advice for writing an AI is to make sure you have a good concept, preferably written down/in diagram form, of how the AI will make decisions on what to do.  It's not an easy thing to write, but hugely satisfying when you finally see it working.  :>
Title: Re: What are you working on? :D
Post by: Pilchard123 on August 16, 2011, 05:26:08 PM
Is there any way of turning of AI for less than all of the empires?
Title: Re: What are you working on? :D
Post by: annikk.exe on August 16, 2011, 05:33:42 PM
In pseudo code:


Code: [Select]
-- empires 0 through 5 have default AI turned off

While Gamerunning do


for i = 0, number of asteroids do

-- AI is on by default
GetAsteroid(i).GraceTimer = 0

for j = 0, 5
if GetAsteroid(i).owner = j then
-- Asteroid belongs to a non-default-AI empire, so turn the default AI off
GetAsteroid(i).GraceTimer = 99999
end
end
end
coroutine.yield()
end
Title: Re: What are you working on? :D
Post by: Pilchard123 on August 18, 2011, 01:38:44 AM
Is there any way of getting the number of asteroids in a map programmatically? My usual approach (infinite for loop) seems not to work...
Title: Re: What are you working on? :D
Post by: Aino on August 18, 2011, 01:41:55 AM
Do the for loop, then check is the GetAsteroid(id) ISN'T nil and then add one the the amount, if it is nil, do a break.
Title: Re: What are you working on? :D
Post by: Pilchard123 on August 18, 2011, 01:42:46 AM
That's what I usually do. Isn't working today.

EDIT: THis code should give a value to highroidID of 9. Instead it gives -1. If you change thae starting point of the for loop, it gives start-1.

Code: [Select]
function LevelSetup()
Globals.G.Asteroids = 10

for i = 0, math.huge do
    if GetAsteroid(i) == nil then
      highroidID = i - 1
  break
    end
  coroutine.yield()
  end
end

function LevelLogic()
MessageBox(highroidID)
end
Title: Re: What are you working on? :D
Post by: Orion63 on August 18, 2011, 01:47:49 AM
Not tested:

Code: [Select]
numberOfRoids = 0
for empireID = 0, GetNumFactions() do

    numberOfRoids = numberOfRoids + GetEmpire(empireID):GetNumOwnedAsteroids()

end

That should work. But I am still kind of a newb in lua, so test it first.
Title: Re: What are you working on? :D
Post by: Aino on August 18, 2011, 01:48:42 AM
Try set highroid to -1 before the loop then make it add one to itself each time a roid is spotted :)

See if it works atleast, worth a shot :)
Title: Re: What are you working on? :D
Post by: Aino on August 18, 2011, 01:50:14 AM
Not tested:

Code: [Select]
numberOfRoids = 0
for empireID = 0, GetNumFactions() do

numberOfRoids = numberOfRoids + GetEmpire(empireID):GetNumOwnedAsteroids()

end

That should work. But I am still kind of a newb in lua, so test it first.

Won't work, didn't even test to see the result!

This is because it's so visible in the math of computers :)
Pre set the variable to -1 not 0, cause if it's 0 you count human wise: -1 it's computer wise(computers love starting at 0 :))
Title: Re: What are you working on? :D
Post by: Pilchard123 on August 18, 2011, 01:52:38 AM
Try set highroid to -1 before the loop then make it add one to itself each time a roid is spotted :)

See if it works atleast, worth a shot :)

Tried that, no luck. I even tried setting it to some massive arbitrary number, to see if that worked. Also no, if you were wondering.

[...]
Won't work, didn't even test to see the result!

This is because it's so visible in the math of computers :)
Pre set the variable to -1 not 0, cause if it's 0 you count human wise: -1 it's computer wise(computers love starting at 0 :))

Also, it won't work, but for a different reason. That code requires that every empire is checked, regardless of its existence. When a non-existend empire is searched, it returns nil and so tries to call a method on a nil value.
Title: Re: What are you working on? :D
Post by: Orion63 on August 18, 2011, 01:56:43 AM
...
...

It wouldn't make sense starting at -1, since it's a simple counter. Add 1 when you find a asteroid, that's it.

Also the 0 starting thing, does not even apply to Lua.
While it supports it 0-starting arrays, Lua's idiom is to start at index 1. Unlike the bazilion programming languages that actually start at 0(Due to C influence).
Either way, it does not change the fact that it has nothing to do with it.

If the code doesn't work(Highly likely), it's not that.
Title: Re: What are you working on? :D
Post by: Aino on August 18, 2011, 01:59:41 AM
Then add an "or 0" the the end... Easy way to handle nil's :)

Edit: Uhhm, it's "or numberOfRoids" not 0, cause 0 will make the variable 0!

Edit 2: doing edits rapidly here, but: This should be added to one of the tutorials, it'll make life easy for some programmers atleast :)
Title: Re: What are you working on? :D
Post by: Pilchard123 on August 18, 2011, 02:02:28 AM
W/ever, I'll do it the old-fashioned way, by hand.
Title: Re: What are you working on? :D
Post by: Aino on August 18, 2011, 02:04:18 AM
W/ever, I'll do it the old-fashioned way, by hand.


(http://images.wikia.com/funnypic/images/1/16/CerealSpitting.png)
Title: Re: What are you working on? :D
Post by: Aino on August 18, 2011, 02:07:05 AM
...
...

It wouldn't make sense starting at -1, since it's a simple counter. Add 1 when you find a asteroid, that's it.

Also the 0 starting thing, does not even apply to Lua.
While it supports it 0-starting arrays, Lua's idiom is to start at index 1. Unlike the bazilion programming languages that actually start at 0(Due to C influence).
Either way, it does not change the fact that it has nothing to do with it.

If the code doesn't work(Highly likely), it's not that.

Heh, but the Asteroid ID's in the game starts at 0, and you don't wanna miss any of them? And it'll run a nil roid at the end, so it would be catastrophic!

Ask any programmer, things in the PC world starts with 0 usually, but Lua's arrays are intended to start at 1 so humans can easily pick it up I guess :)
Title: Re: What are you working on? :D
Post by: Orion63 on August 18, 2011, 02:07:32 AM
Code: [Select]
function GetAsteroidNumber()
numberOfRoids = 0
for empireID = 0, GetNumFactions() - 1 do

     numberOfRoids = numberOfRoids + GetEmpire(empireID):GetNumOwnedAsteroids()

    end

    return numberOfRoids

end

This work. Tested on two built in maps.
Have fun, kids ;)

Nice meme, Aino ^^
Title: Re: What are you working on? :D
Post by: Aino on August 18, 2011, 02:09:04 AM
U tried running a code on the value? I think it will cause a crash o.O
Title: Re: What are you working on? :D
Post by: kmercy on August 18, 2011, 02:09:59 AM
Code: [Select]
function Num()
asteroidnum = 0

for d = 0, 100 do
if GetAsteroid(d) ~= nil then
if GetAsteroid(d).radius > 5 then
asteroidnum = asteroidnum + 1
end
end
end
Pause()
MessageBox(asteroidnum)
WaitDialog()
Unpause()
end

Simple
Title: Re: What are you working on? :D
Post by: Pilchard123 on August 18, 2011, 02:13:11 AM
FUN FACT: I'm an IDIOT!

All/Most of the codes posted work fine. However, if you put them in LevelSetup, they don't take into account any asteroids added randomly, since these are added AFTER LevelSetup. Can you guess where I was counting the asteroids?  :-[

Sorry for wasting everyone's time.
Title: Re: What are you working on? :D
Post by: kmercy on August 18, 2011, 02:14:38 AM
FUN FACT: I'm an IDIOT!

All/Most of the codes posted work fine. However, if you put them in LevelSetup, they don't take into account any asteroids added randomly, since these are added AFTER LevelSetup. Can you guess where I was counting the asteroids?  :-[

Sorry for wasting everyone's time.

Another fun fact thats why its a function so use it where you want :)
Title: Re: What are you working on? :D
Post by: Orion63 on August 18, 2011, 02:14:47 AM
...
...
...

Heh, but the Asteroid ID's in the game starts at 0, and you don't wanna miss any of them? And it'll run a nil roid at the end, so it would be catastrophic!

Ask any programmer, things in the PC world starts with 0 usually, but Lua's arrays are intended to start at 1 so humans can easily pick it up I guess :)

Not the problem, because it's not what I am doing in the code.
In the code, I am looping through all empires(which start by zero), and using the GetNumOwnedAsteroids built-in, which returns the number of asteroids.

i.e.
Empire 0 has 2 roids / Empire 1 has 7 roids / Empire 2 has 6 roids

GetNumFactions will return 3, so I need to loop between 0 and the last empire(which is GetNumFactions() - 1, because indeed it starts at zero)

Code: [Select]
numberOfRoids = numberOfRoids + GetEmpire(empireID):GetNumOwnedAsteroids()This on the first run will return 2
On the second it will return 2 + 7 = 9
On the third run it will run 9 + 6 = 15

And in the end returns the last result, which is 15.(What I am not entirely sure, is if empty asteroids have a empire assigned to them. If not, this won't work...)
Title: Re: What are you working on? :D
Post by: kmercy on August 18, 2011, 02:16:52 AM
Quote
Not the problem, because it's not what I am doing in the code.
In the code, I am looping through all empires(which start by zero), and using the GetNumOwnedAsteroids built-in, which returns the number of asteroids.

i.e.
Empire 0 has 2 roids / Empire 1 has 7 roids / Empire 2 has 6 roids

GetNumFactions will return 3, so I need to loop between 0 and the last empire(which is GetNumFactions() - 1, because indeed it starts at zero)

Code:
numberOfRoids = numberOfRoids + GetEmpire(empireID):GetNumOwnedAsteroids()
This on the first run will return 2
On the second it will return 2 + 7 = 9
On the third run it will run 9 + 6 = 15

And in the end returns the last result, which is 15.(What I am not entirely sure, is if empty asteroids have a empire assigned to them. If not, this won't work...)

Thats why you just use what i posted
Title: Re: What are you working on? :D
Post by: Orion63 on August 18, 2011, 02:20:44 AM
Quote
Not the problem, because it's not what I am doing in the code.
In the code, I am looping through all empires(which start by zero), and using the GetNumOwnedAsteroids built-in, which returns the number of asteroids.

i.e.
Empire 0 has 2 roids / Empire 1 has 7 roids / Empire 2 has 6 roids

GetNumFactions will return 3, so I need to loop between 0 and the last empire(which is GetNumFactions() - 1, because indeed it starts at zero)

Code:
numberOfRoids = numberOfRoids + GetEmpire(empireID):GetNumOwnedAsteroids()
This on the first run will return 2
On the second it will return 2 + 7 = 9
On the third run it will run 9 + 6 = 15

And in the end returns the last result, which is 15.(What I am not entirely sure, is if empty asteroids have a empire assigned to them. If not, this won't work...)

Thats why you just use what i posted

Yap, yours will run even if empty asteroids are not assigned to empires ;)
Title: Re: What are you working on? :D
Post by: Pilchard123 on August 18, 2011, 02:22:19 AM
Empty asteroids belong to Empire 0, the greys.
Title: Re: What are you working on? :D
Post by: Aino on August 18, 2011, 02:26:49 AM
I guess I was wrong :)
Title: Re: What are you working on? :D
Post by: Orion63 on August 18, 2011, 02:44:12 AM
Empty asteroids belong to Empire 0, the greys.

Thank you, for the info ;)

Don't worry Aino. The reason why we, programmers and designers, gather in communities, is to improve ourselves ;)
Title: Re: What are you working on? :D
Post by: Aino on August 23, 2011, 01:02:18 AM
Since everybody decided to be silent, I'll break it and ask:

What are you working on? :D
Title: Re: What are you working on? :D
Post by: Bonobo on August 23, 2011, 09:28:40 AM
Real Life
Title: Re: What are you working on? :D
Post by: Aino on August 23, 2011, 01:36:48 PM
I'm kinda busy there myself, school and all, but noone posts in some periods and it's kinda... boring :P
Title: Re: What are you working on? :D
Post by: Bonobo on August 23, 2011, 04:24:35 PM
One wisdom my late father taught me: Never admit that you’re bored—bored people usually are boring ;)
Title: Re: What are you working on? :D
Post by: Aino on August 23, 2011, 07:27:45 PM
But I'm not boring :D
Title: Re: What are you working on? :D
Post by: Aino on August 23, 2011, 10:54:16 PM
What is cot,sec and csc? They are short versions for Trigonometric functions, on the wiki site they are just a wide wall of calculations which to a normal human like me(I'm young though...) can't understand...
Title: Re: What are you working on? :D
Post by: Pilchard123 on August 24, 2011, 01:05:33 AM
sec(x) = secant(x) = 1/cos(x)

cosec(x) = cosecant(x) = 1/sin(x)

cot(x) = cotangent(x) = 1/tan(x)

They are the reciprocal functions of the three basic trig functions - ie cot(x) X tan(x) = 1

Why d'you ask?

Also, regarding DrawRegPoly, I remembered yesterday (well, I knew I had it, but not how long I'd left it) that I had over half of that summer assignment to write. I'll prolly be on much less for a while, while I write boring Java exercises.

Code: [Select]
public int tediousExercise(){
Scanner scan = new Scanner(System.in);

try{
int i = scan.nextInt();
scan = null;
return  i;//evidence-required obvious comment
} catch (NoSuchElementException e){
System.out.println("Invalid");//evidence-required obvious comment
scan = null;
return tediousExercise();
}
}//zzzz
Title: Re: What are you working on? :D
Post by: Aino on August 24, 2011, 01:37:16 AM
You know, you can't learn too much :)

But what are the uses of them them?

Edit: Nice code, understood everything in it :D
Sad thing there is no such big thing as Try/Catch in Lua, ofcourse you have if value ~= nil, but with try/catch yuo can find an error running inside an entire code :P
Title: Re: What are you working on? :D
Post by: Pilchard123 on August 24, 2011, 02:22:36 AM
You can always use print() to debug. In Eufloria, this is output to the dev console.
Title: Re: What are you working on? :D
Post by: Aino on August 24, 2011, 02:24:21 AM
Yes, thats true... :)

But I wonder how to do a A* search algorithm... Any ideas? I'm jsut curious :)
Title: Re: What are you working on? :D
Post by: Pilchard123 on August 24, 2011, 02:34:11 AM
A* search? No idea. You may want to look at the Lua function assert() , which is a bit like try-catch.

Edit: Wikipedia has some good psedocode that you could probably use to start, at least.
Title: Re: What are you working on? :D
Post by: Aino on August 24, 2011, 02:41:30 AM
Ugh, I hate encoding codes, but I'd better get to doing it if I wanna learn this :/
Title: Re: What are you working on? :D
Post by: Aino on August 24, 2011, 02:47:48 AM
Mehh, I'll do my own :D

Seeing the behaviour of the a* I can do my own one, hopelyfully very resourceefficient too :D
Title: Re: What are you working on? :D
Post by: Orion63 on August 24, 2011, 05:03:50 AM
I am curious, in what you way will you implement A* in Eufloria?
Anyway, if you're planning to implement it to move seedlings from planet to planet without the default algorithm, I suggest the Dijkstra's Algorithm. Even if it is a bit performance heavy(normal eufloria game, doesn't contain enough planets to such delay be noticeable, anyway), it does provide the optimal path and while A* can give pretty good results, you have to have a good heuristic function(and trust me, it will give you a bad headache, if it complicates just a little).
Also if you already started to program the A* algorithm, the Dijkstra's Algorithm is the same as A* when the heuristic function always evaluates to 0.
Good luck ;)

What am I working on?
When I get the courage to awake the beast(microsoft), I was thinking about making some random map, or something, just to test some things, I've been wondering. Either way, the sky has cleared out, so the next days, I might work on my tan instead :-P.

PS: Aino, school already? You guys start really early there...I still have 3 weeks(Jesus Christ, the time is running out :'( ).

Edit: If I had to guess, how does Eufloria handle seedling's paths, I would say, that whenever a planet is created(normally in LevelSetup) a path is calculated by Dijkstra's(It seems to be always the shortest distance...), and stored into a hash table(Lua -> table).
ie:

Code: [Select]
{2 : 1, 3, 2} //To go to planet whose ID is 2, go to 1, 3 and finally 2...
This would avoid repetitive calculations, and since the original campaign is mostly statics(Asteroids are not randomly created/killed, nor move), all is calculated in LevelSetup...happy ending
Of course...This is just a wild guess. A* algorithm is probable as well, specialty since whenever Eufloria gives me the LowMemory error, is on LevelSetup(A* while faster, is more memory expensive).
Cheers.
Title: Re: What are you working on? :D
Post by: Aino on August 24, 2011, 05:21:11 AM
I'm just doing it for my own learning, as I'm wanting a future as a game programmer/desifgner I'll have to know such basic things like an a* search algorithm :)

But everythiong is just falling apart, I have a problem with the neighbouring system, something which pains me. But now off to bed, theres a new day tommorow :)
Title: Re: What are you working on? :D
Post by: annikk.exe on August 24, 2011, 08:18:49 AM
I just bought Ableton Live and am installing it.

Then I will process some sounds with my Culture Vulture Stereo Analog Distortion Unit for my friend James.  :>
Title: Re: What are you working on? :D
Post by: Aino on August 25, 2011, 04:39:27 AM
Hmm, I wonder how you are supposed to convert screen into level, or calculating where everything is supposed to stay at that camrazoom and that cameraX/Y. I do not directly talk about Eufloria, but any overhead games(games where you look down at the world)...

It's very hard to explain, so let's imagine Minecraft, with topview. How do you know where every single block is placed on the screen? It's an easy deal with the level, but converting that into the screen it might get harder...
Title: Re: What are you working on? :D
Post by: Aino on August 26, 2011, 12:44:26 AM
Ok, my game is soon finished, some extra polishing and it's good to go :D

It might not be what you expect, it's a simple Eufloria game, with more futuristic look and not so dynamic/natural...
Title: Re: What are you working on? :D
Post by: Aino on August 26, 2011, 04:58:25 AM
Final thing to add: Saving!

I'll do the saving complex, I don't know why, but I'll just do it complex...
Title: Re: What are you working on? :D
Post by: Pilchard123 on August 26, 2011, 06:18:34 AM
So...squares instead of circles?

(http://www.thinkgeek.com/images/products/additional/large/e849_confused.jpg)
Title: Re: What are you working on? :D
Post by: Aino on August 26, 2011, 02:40:21 PM
If yopu're talkihng about the game, it's made of circles, don't you worry :)
Title: Re: What are you working on? :D
Post by: Aino on August 27, 2011, 01:51:38 AM
Finally finished the save/loading, now to add a button to it in the GUI x.x
Title: Re: What are you working on? :D
Post by: Aino on August 27, 2011, 07:30:56 AM
Doing some final polishing now, I've made a very simple saving/loading system, some buttoms away and you're in the action again :D

You get 5 file saves to use, they are have buttons on each side telling if you want to load or save the file, and you can delete all content too of course!
Title: Re: What are you working on? :D
Post by: Aino on August 28, 2011, 11:00:35 PM
I attached a strange file...

It's a very very early PROTOTYPE of what I've been having in mind.

(click to show/hide)

The prototype is called "God" :)

Edit: And lol, to use the map: Right click three times in arow to change mode, is the ball on the mouse is blue you pick up and if it's red you place the availible picked ups :)
Title: Re: What are you working on? :D
Post by: Aino on August 30, 2011, 02:40:31 AM
Ok, so now I'm trying myself on 3D rendering, but I need tons of help, and yes I know about annikks 3D, but I have some problems when it comes to encoding codes that are made, if I watch somebody build up the code, it looks just fine, but even if it's commented it's still hard. I don't like having to break up a code and see exactly whats going on, but if it goes step by step, it's much easier... All I currently understand it that you need a x,y,z :P
Title: Re: What are you working on? :D
Post by: Aino on September 05, 2011, 02:43:25 AM
Anyone here coding c#? Because I want to know how to tell the difference between rigth/left click, which way you are scrolling the mouse and what buttons on the keyboard you are pressing...
Title: Re: What are you working on? :D
Post by: kmercy on September 05, 2011, 02:21:53 PM
look into keyhooks
Title: Re: What are you working on? :D
Post by: Aino on September 05, 2011, 02:39:21 PM
Nice, but I'll look into that as I've fixed scrolling and mouse movement/clicking with the mouse...
Title: Re: What are you working on? :D
Post by: Pilchard123 on September 05, 2011, 04:59:58 PM
http://www.codeproject.com/KB/system/globalmousekeyboardlib.aspx

http://social.msdn.microsoft.com/Forums/en/csharpgeneral/thread/20ab0496-533b-433b-a309-6b0ff5f6017e

Try these. The top link is to the library's development/help page, the second is an MSDN thread about installing it. (There's only two posts though)

I think therer is a way to get it to work with .NET 4.0, but you may have to do a little hacking together.
Title: Re: What are you working on? :D
Post by: Pilchard123 on September 05, 2011, 05:02:28 PM
New post cuz this is a bit big. Taken from the top link in my previous post, second page of comments. Replace the Start() function in GlobalHook with this Start() function. Also, remember I know NO C#.

Quote
Class GlobalHook
 
public void Start()
{
      if (!_isStarted && _hookType != 0)
            {
 
                // Make sure we keep a reference to this delegate!
                // If not, GC randomly collects it, and a NullReference exception is thrown
                _hookCallback = new HookProc(HookCallbackProcedure);
 
                _handleToHook = SetWindowsHookEx(
                    _hookType,
                    _hookCallback,
                    System.Diagnostics.Process.GetCurrentProcess().MainModule.BaseAddress,
                    0);
 
                // Were we able to sucessfully start hook?
                if (_handleToHook != 0)
                {
                    _isStarted = true;
                }
 
            }
}
Title: Re: What are you working on? :D
Post by: Aino on September 06, 2011, 02:08:45 PM
So, I have another question(regarding C#) and that is:

How do I reset my screen, or remove all of the drawings I've done? I've treid to clear all the graphics and redraw the background, but it only gives flickering... So any idea?
Title: Re: What are you working on? :D
Post by: kmercy on September 06, 2011, 07:52:31 PM
Graphics.Clear();

should clear them all then you redraw after presuming thats how you are doing it but i would need to see the code to see how you are drawing them
Title: Re: What are you working on? :D
Post by: Aino on September 06, 2011, 09:14:12 PM
No, you need a color, and setting it no color makes it black x.x

Also the flickering that's made by setting the background also makes it impossible to see anything...
Title: Re: What are you working on? :D
Post by: kmercy on September 07, 2011, 01:20:08 AM
that makes no sense you since thats what you asked how to get rid of the drawings so you will need to post the code
Title: Re: What are you working on? :D
Post by: Aino on September 07, 2011, 02:30:58 PM
Here:

Code: [Select]
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Collections;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {

        public double Zoom = 4;
        public double CameraX = 0;
        public double CameraY = -100;
        public int XPos = 100;
        public int YPos = 100;
        public bool[] MDown;
        public int MouseClicks = 0;

        public Form1()
        {
            InitializeComponent();
        }

        public void Render()
        {

            Graphics g = Panel.CreateGraphics();

            g.DrawImage(Bitmap.FromFile("C:\\Users\\User\\Desktop\\C# Examples\\Test2\\WindowsFormsApplication1\\WindowsFormsApplication1\\Picture.png"), Convert.ToInt32(CameraX) + XPos, Convert.ToInt32(CameraY) + YPos, Convert.ToInt32(400 * Zoom), Convert.ToInt32(400 * Zoom));

        }

        private void Timer_Tick(object sender, EventArgs e)
        {
            Render();
        }


        protected override void OnMouseDown(MouseEventArgs e)
        {
            switch (e.Button)
            {
                case (MouseButtons.Left):
                    MDown[0] = true;
                    break;
                case (MouseButtons.Middle):
                    MDown[1] = true;
                    break;
                case (MouseButtons.Right):
                    MDown[2] = true;
                    break;
                case (MouseButtons.XButton1):
                    MDown[3] = true;
                    break;
                case (MouseButtons.XButton2):
                    MDown[4] = true;
                    break;
            }
            MouseClicks = e.Clicks;
        }

        private void Panel_Scroll(object sender, ScrollEventArgs e)
        {
            if (e.NewValue != 0)
            {

                Zoom = Zoom * (1 + (e.NewValue / (720*Zoom)));

            }
        }
    }
}

Have been focusing on other things since all the comments, I'll begin making progress soon hopelyfully :)

But I don't understand why the scrolling isn't working, the mouse clicking is fine though :P
Title: Re: What are you working on? :D
Post by: Aino on September 11, 2011, 02:44:13 PM
Ok, I've been going to java again, I know it very well too! But theres that one problem I face always!

You want to have classes to separate things easier and stuff, you don't use Arrays, like I did on Eufloria! So when it comes to check something with all the units from one class, you need an array to span over all of them to be able to select them. But I get a crash whenever doing that!

So, any idea of how to be able to select all of the different units from one class without any problems?
Title: Re: What are you working on? :D
Post by: Pilchard123 on September 11, 2011, 07:04:40 PM
Thirteen and a half years old, but might be of use.

http://java.sun.com/developer/technicalArticles/ALT/Reflection/
Title: Re: What are you working on? :D
Post by: Aino on September 14, 2011, 10:31:12 PM
So this will leave me with something like this:

Code: [Select]

NumThings = 0
Text = {}

for i = 1,math.random(1,1000) do

NumThings = NumThings + 1
Text[i] = math.random(1,100)

end

for i = 1,NumThings do

print(Text[NumThings])

end

Considerd a basic example :)
Title: Re: What are you working on? :D
Post by: Aino on September 28, 2011, 03:53:24 AM
I believe I'll create a new map soon, It's gonna be weirder than weirdest!

An, what I meant was(in the previous posts): to run through the objects from a class, like say it's three objects from the same class:

Quote
Name: Betty
Income: 300$ daily
Taxes: 50
Children: 0
Quote
Name: Chuck Testa
Income: 999999999$ daily
Taxes: 0
Children: 35557968 dead animals
Quote
Name: Alex
Income: 750$ daily
Taxes: 100
Children: 2

Now each have their individual name, income, taxe and amount of children. But they all come from the same class... This is called polymorphism!

What I looked for was how do I check a field/run a method from every single object from the same class?

And whis is polymorphism, what you guys told about polymorphism is overloading methods :)
I also hope this is useful for newbies, polymorphism is a simple thing, but very hard to learn...
Title: Re: What are you working on? :D
Post by: Orion63 on September 28, 2011, 04:44:09 AM
Now each have their individual name, income, taxe and amount of children. But they all come from the same class... This is called polymorphism!

Hum...Nope...That's just regular objected-oriented programming...

Quote
What I looked for was how do I check a field/run a method from every single object from the same class?

Store all objects created in a array, and loop through it....
Title: Re: What are you working on? :D
Post by: Aino on September 28, 2011, 03:12:25 PM
I knew it was called Object-orienting, but it's also called Polymorphism(atleast what I've learnt...).
Title: Re: What are you working on? :D
Post by: Pilchard123 on September 30, 2011, 01:06:41 AM
*bzzzzt*

Nope, it's not.
Title: Re: What are you working on? :D
Post by: Aino on October 01, 2011, 01:56:22 AM
Well, Polymorphism is several things, and Object-orienting is one, Method/Function overloading is another(why call any of this polymorphism when they have indivdual names too?) and another thing. Read http://en.wikipedia.org/wiki/Polymorphism_%28computer_science%29!

So, Polymorphism is both overloading methods and functionad and object-orienting! Do we agree now? :)
Title: Re: What are you working on? :D
Post by: Orion63 on October 01, 2011, 04:22:44 AM
You know, you're quoting an article that gives us reason, right?

Is Subtype Polymorphism, what you're confusing by Object Oriented programming?

An example of subtype polymorphism, the good old shape example(I have a Pascal(aka old) programming book with that example ^^)
Language is Python, because it's the closest thing to pseudo-code...

Code: [Select]
Class Shape(object):
    def getArea(self):
        pass

class Square(Shape):
    def getArea(self):
        return self.side ** 2)

class Circle(Shape):
    def getArea(self):
        return math.pi *self.radius ** 2

Since any shape can have his area measured, it makes sense, that the Shape class has a getArea method. But you can't determine the area of any random shape, by the same method, so you use different methods, with the same goal...



Title: Re: What are you working on? :D
Post by: Aino on October 01, 2011, 06:00:20 AM
Is that polymorphism?

So in one post you guys tell me it's Overloading Methods, and now it's classes using another class object?

Atleast what i've learnt from this point, is that Overloading Methods, like this:

Code: [Select]
public class something{

public int squareroot(double a)
{
return Math.round(Math.round(Math.Sqrt(a)));
}

public float squareroot(double a)
{
return Math.round(Math.Sqrt(a));
}

public double squareroot(double a)
{
return Math.Sqrt(a);
}

}

And Object-Orienting:

Code: [Select]

public class lol {

private Something s;

public static void main(String[] args){

s = new Something();

}

}

public class Something{

private x;
private static numThings;

public Something(){

x = 1;
numThings++;

}

}

Both are in Java...
Title: Re: What are you working on? :D
Post by: Orion63 on October 01, 2011, 09:19:22 AM
Yep, that looks right...

Like in the Wikipedia article you quoted, you could have read that polymorphism is a lot of things... I immediately recognize polymorphism as overloading methods, due to it's C usage, most recognize as subtype polymorphism due to it's usage in both C++ and Java, both widely used languages, and there's still parametric polymorphism used by the functional folk.
Title: Re: What are you working on? :D
Post by: Pilchard123 on October 01, 2011, 09:52:15 PM
Polymorphism actually means "having many forms", from the Greek poly (many) and morphe (form)  .

Basically, taking one thing, and changing how it is, but still being the same. In CS, overloading methods is one way of using polymorphism, as is inheritance of classes/datatypes.
Title: Re: What are you working on? :D
Post by: Aino on October 01, 2011, 10:54:55 PM
Pilchard, look at your posts counter... I don't like that number... (666 is the number...)
Title: Re: What are you working on? :D
Post by: Orion63 on October 02, 2011, 12:31:59 AM
111 posts for divinity ^^
Title: Re: What are you working on? :D
Post by: Aino on October 03, 2011, 04:57:24 AM
Hmmm, I got a question:

In java, how do you find a specific object in a list provided the info that object on the list should have? I mean, a list goes from 0, infinite(fine by me) and contains data, or an object filled with data. Now you don't really wanna go from 0, 40 just to find the correct object, you would rather want to have the object coming to you instantly. Like if you could write in the data in the list to get to it. Though this works in lua, but not java...

A brief example:

Code: [Select]
List:
0: 0,0,0
1: 0,0,1
2: 0,0,2
3: 0,0,3
4: 0,0,4
5: 0,0,5
6: 0,0,6
7: 0,1,0
...

You want the data in 7, but you don't really know that 7 contains the data. So you do a for loop though all of them to find the perfect match. But this takes performance... So we'd like to go directly to the object with the data you require, meaning no for loop. But how the heck would you do this if theres over 1000 objects on the list and only one match?

So is there any way to do that shortcut, to prevent lag?
Title: Re: What are you working on? :D
Post by: Orion63 on October 03, 2011, 11:03:50 PM
I am pretty sure that Lua method is just sugar candy for a wrapped C for-loop...
Either way, if you're really not feeling like doing a for loop, you can use a hash table, with a decent hash function...
If you manage to do a perfect hash function, to your data(no collisions), time complexity will O(1), compared to the average O(n/2) that the for loop, provides...

Still, if it's only 40(or even somewhat larger ranges), it's not worth the trouble, and it will probably be slower...
Title: Re: What are you working on? :D
Post by: Aino on October 04, 2011, 12:42:15 AM
I figured it out, I jsut made an arrqay inside of the class, telling who the nighbours are, and they are checked when level is created.

Also, the size of the array would minimally be 20x20x20, so it's a large number!
Title: Re: What are you working on? :D
Post by: Pilchard123 on October 04, 2011, 03:23:06 AM
Set up a binary search for the data. You can reuse it quite easily then as well.

Admittedly this requires the data to be sorted as well, but that isn't monstrously hard to do either. It depends how you set up your data in the first place.
Title: Re: What are you working on? :D
Post by: Aino on October 04, 2011, 04:44:01 AM
Heh... But I got another problem, I need to get an object that could be anything, like it's not predefined...
Title: Re: What are you working on? :D
Post by: Orion63 on October 04, 2011, 05:37:07 AM
Hum?Sorry, didn't understand. Can you elaborate?
Title: Re: What are you working on? :D
Post by: Aino on October 04, 2011, 05:42:40 AM
Well, I walked through some video tutorials by TheNewBoston(highly reccomended, seriously!!!) and he began talking about an object that can have any shape, so it's and object... a simple object with no specific form... I've figured out that this "object"¨s name is simply... "Object" when you write it on the code x.x

So... Lol!
Title: Re: What are you working on? :D
Post by: Pilchard123 on October 05, 2011, 01:28:29 AM
De quoi?
Title: Re: What are you working on? :D
Post by: Aino on October 05, 2011, 03:03:28 AM
"Object" in java is the super class for all object, nuff said.

But the binary search, how fast is the while loop usually?

And is it "lag-free" for 2d search? Like X,Y?
Title: Re: What are you working on? :D
Post by: Orion63