Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411507 Posts in 69374 Topics- by 58429 Members - Latest Member: Alternalo

April 26, 2024, 08:00:20 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityDevLogsEnso - A planetary twin-stick shooter, with space combat
Pages: 1 [2] 3
Print
Author Topic: Enso - A planetary twin-stick shooter, with space combat  (Read 13360 times)
Mya
Level 0
***



View Profile WWW
« Reply #20 on: March 22, 2015, 06:50:17 AM »

Gahhd this looks ace.

Super-cool work man, love the simple art style.
Logged

bithead
Level 0
**



View Profile WWW
« Reply #21 on: March 28, 2015, 08:17:54 AM »

Thanks Mya! I feel the same about BrainBox, love it Smiley
Logged

bithead
Level 0
**



View Profile WWW
« Reply #22 on: March 28, 2015, 12:06:03 PM »

Weekly Update #4

Neural Networks and Genetic Algorithms!

Since I'm starting work on flight AI, I figured it's a perfect excuse to try developing a NN/GA system! I got most of the technical details from these excellent articles on ai-junkie: Neural Nets, Genetic Algorithms

Turns out they aren't much work to setup the basic code, but they are very complex to understand at a deep level. Here's what I learned over the past week:

The Neural Net

My requirement was simply to discover a way to reduce an agent's distance from a target, hopefully in an "interesting" way. The ships have 3 degrees of freedom: pitch, roll, and forward thrust. These become the output of the neural net. The inputs are the angular correction in yaw, and pitch required to face the target. You could also use the dot product, and save 1 input (thereby making the system less complex, and training faster) although, when I tried, it appeared to learn faster using discrete yaw/pitch angles. I don't know enough about how the hidden layers in NNs work for me to say why, maybe it was just coincidence Durr...?.



2 inputs (plus a bias), 3 outputs, and 1 hidden layer, with 6 neurons (using sigmoid activation).


Genetic Algorithm

From what I gather, the GA setup I is pretty standard: mutation rate of 10%, chromosome crossover rate of 0.7, and a population of 50 agents.

The fitness equation is just the grade each agent receives, based on how well an agent satisfies it's goal. My initial fitness equation was the inverse of the distance between an agent and it's target (closer = higher fitness). It was enough that the AIs eventually learned to fly towards their target.

Of course, emergent behavior is all part of genetic algorithms, though often undesirable. The agents learned to close the distance to a target, but in my case they also barrel roll continuously. Even though it's technically solving the problem, it looks ridiculous, so I had to modify the fitness equation to be more specific. Z-axis rotations are now penalized heavily, but not too much as to prevent them from rotating at all, or interfere with the primary goal of reaching their target.





Because of the relative simplicity of my setup, training was quick, and I can evolve decent looking candidate after around 25 generations.

It's a lot of fun to watch the agents evolve over time, and produces decent results. But I could have spent a fraction of this time manually writing the flight code myself with very similar results. A lot of time is spent tweaking values, and waiting for the system to do it's thing, before you see how your changes. It becomes tedious, and made me realize using a NN/GA for such a basic problem of "fly from A to B" is silly -- unless you're training an actual spacecaft to fly in actual space. I simply hoped a visually interesting technique would come out of it, but I realize now that there isn't enough freedom or complexity for stylish "creativity" to emerge in how I set it up.

I think a better use case might be in high-level decision making, like when to switch to chase/evade when given inputs like health, target distance, and other situational variables.

Thanks for reading!
« Last Edit: March 29, 2015, 12:16:29 PM by bithead » Logged

Seaport
Level 1
*



View Profile WWW
« Reply #23 on: March 30, 2015, 11:48:25 PM »

This is looking good, I find small rotating worlds appealing and being able to go from space to the planet seamlessly is a big pull for me, Looking forward to seeing more
Logged

Jin_K
Level 0
**



View Profile
« Reply #24 on: March 31, 2015, 02:13:25 AM »

It is a good way to start using a genetic algorithm, you can always go deeper with it later.
I can imagine so many ways to use it in a project like that, you could teach different type of space ships to fly, but also to shoot and land.
Very interesting devlog, I'm following this.
Logged
Mittens
Level 10
*****

.


View Profile WWW
« Reply #25 on: March 31, 2015, 05:39:32 AM »

I am currently developing a very similar game to this...THISMEANSWAH!
Logged

Mittens
Level 10
*****

.


View Profile WWW
« Reply #26 on: March 31, 2015, 05:41:56 AM »

But seriously, this looks really good. It's not actually like my game in form or style, just in concept.

Ever since I played Spore I've been wondering why there haven't been more games exploring the wide range of interesting concepts it demonstrated.

I dig your flat/minimal art-style, very likable
Logged

bithead
Level 0
**



View Profile WWW
« Reply #27 on: March 31, 2015, 12:50:53 PM »

This is looking good, I find small rotating worlds appealing and being able to go from space to the planet seamlessly is a big pull for me, Looking forward to seeing more

Thanks for the feedback Smiley

I am currently developing a very similar game to this...THISMEANSWAH!

Haha Smiley It feels like the planet trend is hot right now! No need for war... there is enough space for everyone!

It is a good way to start using a genetic algorithm, you can always go deeper with it later.
I can imagine so many ways to use it in a project like that, you could teach different type of space ships to fly, but also to shoot and land.
Very interesting devlog, I'm following this.

It's true, GAs seem like they have so much potential. I feel like it may be overkill for this particular project, especially since they can be such a time suck. But man, they are fun to play with.
Logged

gimymblert
Level 10
*****


The archivest master, leader of all documents


View Profile
« Reply #28 on: March 31, 2015, 02:12:56 PM »

Posting to follow.
 Durr...?
Posting to follow too Crazy
Logged

sidbarnhoorn
Level 3
***


View Profile WWW
« Reply #29 on: April 01, 2015, 06:34:16 AM »

This looks great. Looking forward to playing this. :-)
Logged

Siddhartha Barnhoorn
--------------------
Award winning composer

Composed music for the games Antichamber, Out There, The Stanley Parable, Planet Alpha...

Website:
http://www.sidbarnhoorn.com
Bandcamp:
https://siddharthabarnhoorn.bandcamp.com
Twitter:
https://twitter.com/SidBarnhoorn
Chromanoid
Level 10
*****



View Profile
« Reply #30 on: April 01, 2015, 09:49:23 AM »

Hand Any Key
Logged
bbtombo
Level 1
*


lvl 2 spellcaster


View Profile
« Reply #31 on: April 01, 2015, 10:27:05 AM »

looks incredible so far!
Logged

CaLooch
Level 0
***


lost in thought...


View Profile
« Reply #32 on: April 07, 2015, 05:22:29 AM »

This looks like it has SO much potential.  Will definitely be checking in regularly on this.

Just wondering, whats your background? 
Logged

TinyAngryCrab
Level 0
**


o


View Profile
« Reply #33 on: April 07, 2015, 06:21:36 AM »

I love the idea of using genetic algorithms and neural nets, but look out for weird edge case behaviour!

Anyway, good stuff so far - would be interested to see how you plan to make the combat gameplay link to the exploration.
Logged
bithead
Level 0
**



View Profile WWW
« Reply #34 on: April 07, 2015, 04:50:49 PM »

Just wondering, whats your background?

Worked as a gameplay/AI programmer for a number of years in AAA.

I love the idea of using genetic algorithms and neural nets, but look out for weird edge case behaviour!
Anyway, good stuff so far - would be interested to see how you plan to make the combat gameplay link to the exploration.

Yeah, they're very quirky. Not sure I want to dedicate the time to mess around with them in this particular project, but likely in another (smaller) project I have in mind for the future.
Logged

bithead
Level 0
**



View Profile WWW
« Reply #35 on: May 27, 2015, 07:46:41 AM »

Development continues! Working on a conversation system.

Logged

bithead
Level 0
**



View Profile WWW
« Reply #36 on: May 29, 2015, 06:28:42 AM »

Weekly Update #5


Conversations can occur while walking on planets, and also over ship communicators. Conversation graphs are comprised of NPC and player dialog nodes. I'm adding nodes for conditional branching, setting variables, loading external conversation trees, and triggering events/animations.
« Last Edit: September 12, 2015, 05:04:52 PM by bithead » Logged

bithead
Level 0
**



View Profile WWW
« Reply #37 on: September 12, 2015, 06:24:01 PM »

Update 6

New Player Ship

I'm working on a few projects now, so it's been a while since my last update. I'm obviously failing at the "weekly" updates, so I'll just do smaller posts whenever I can, as I make progress.

I revised the player ship design. I want to maintain a visual contrast between the player and the robots. The player will be primarily white, with blue and green highlights. The robots are likely to be a darker grey base, with red highlights.

« Last Edit: September 14, 2015, 06:08:56 AM by bithead » Logged

bithead
Level 0
**



View Profile WWW
« Reply #38 on: September 14, 2015, 06:07:14 AM »

Update 7

Ship HUD

I've been spending some time fleshing out the space combat, and came up with a design for the HUD. Freespace has been a significant influence.

My goal is to keep everything simple, appealing, and intuitive. I still have to figure out how I'm going to indicate the function of each gauge (icons/text, or something). The outer left is the thrust, inner left is boost. Outer right is shield, and inner right is hull integrity.

When you aim at a target's lead indicator, the reticule changes to yellow, and the center of the reticule will follow the target to let you know that aim assist is engaged.

You can also see the shields, and boost.



HUD opens, gauges refill
Aim assist reticule


Logged

TankDuck
Level 0
**


View Profile
« Reply #39 on: September 14, 2015, 06:58:52 AM »

Holy moses. Amazing stuff and really cool dev-log. I'm relieved that you mentioned you've worked professionally, I was under the impression you're some kind of super-human bedroom programmer putting us to shame.  Durr...?

I am a big fan of the minimal / flat UI you've gone for it has some obvious similarity's to Star Wars Battlefront / Destiny. Its nice and clean!

I think if I have any feedback its perhaps a little on the large size,

You could possibly use the frosty glass / blurred effect on the gray areas too, especially if you start introducing text.

The minimap in the bottom left is a good example.
http://static1.gamespot.com/uploads/original/1539/15391776/2887873-screen+shot+2015-06-16+at+3.05.42+pm.png

Cheers!
Logged
Pages: 1 [2] 3
Print
Jump to:  

Theme orange-lt created by panic