Omnimaga

Calculator Community => TI Calculators => Lua => Topic started by: Nick on May 28, 2012, 02:55:56 pm

Title: [Contest] Osmos
Post by: Nick on May 28, 2012, 02:55:56 pm
Hi

I made this topic to present you the first stage of my 'Omnimaga Contest 2012: AI'-project.
Some of you may have already heard the (n/g)ame Osmos..

Osmos is a game in which you are a (life)cell and you have to complete several targets.



you are a dark blue cell, and live together with other creatures (cells). Some of them are nice, others try to destroy you, so watch out!
you can move by clicking 'behind' him. it gives you speed, but it also decreases your size, so you have to choose wisely..
Smaller normal cells are lighter blue, bigger normal cells are red. If a cell is bigger than you it absorbs you (and you obviously die), but if you can absorb a smaller cell you grow.

There are special lifeforms such as biophobias and other (forgot the names xp ), and those are special.
The biophobias are the only ones i implemented already, and they are those green cells. And this is where the AI comes in.
If you look closely, you can see the biophobia tries to escape from you if you are bigger than him, but he 'sees' the cells around him and absorbs the ones that are smaller.
This means he grows faster than the normal cells, so you'll have a hard time fighting them...

as you can see in the screenshot, i already reached a reasonable state after 2 days of working. But there are a lot of glitches and bad things in it though..
The AI has to be better, since it sometimes gets stuck between two big cells, and thus starts to shake between those 2 :)

Nick
Title: Re: [Contest] Osmos
Post by: Darl181 on May 28, 2012, 03:00:16 pm
I'm liking the concept, graphics are pretty good too. :)
Good luck with this!
Title: Re: [Contest] Osmos
Post by: Sorunome on May 28, 2012, 03:03:32 pm
Wha, that's looking cool!
Good luck with it!
Title: Re: [Contest] Osmos
Post by: Jim Bauwens on May 28, 2012, 03:07:54 pm
This looks and sounds very nice !
Good luck and have fun coding :)
Title: Re: [Contest] Osmos
Post by: stevon8ter on May 28, 2012, 03:41:40 pm
Wow, very nice

But where is the screenie? :/ and what  platform? Axe, asm,...
Title: Re: [Contest] Osmos
Post by: Nick on May 28, 2012, 03:53:51 pm
thanks everyone :)

But where is the screenie?

it's a youtube video (embedded) i posted here, maybe you can't see it because of you ipod or something..

what  platform? Axe, asm,...

it's nspire, which you could see in the screenie, but that seems to be hard for you though xp
Title: Re: [Contest] Osmos
Post by: stevon8ter on May 28, 2012, 04:10:29 pm
No i see it, then it's very very nice, i thought it was based on the video, but it is the video :o that's one amazing game you allready made man
Title: Re: [Contest] Osmos
Post by: cyanophycean314 on May 28, 2012, 04:30:17 pm
Nice job there. You had brought this idea up in another place, and I had actually considered doing something like this.  :P

It looks really cool.  :D
Title: Re: [Contest] Osmos
Post by: Deep Toaster on May 28, 2012, 04:34:52 pm
Wow, nice concept. It kinda reminds me of Flow (http://interactive.usc.edu/projects/cloud/flowing/), and it looks really fun :D
Title: Re: [Contest] Osmos
Post by: Nick on May 28, 2012, 04:35:05 pm
Nice job there. You had brought this idea up in another place, and I had actually considered doing something like this.  :P

It looks really cool.  :D

yes i did, in some challenge me topic, but i'm not sure who's topic it was.. and i was like AI, hmm, where did i see an AI lastly, and then i came across that video :)
Title: Re: [Contest] Osmos
Post by: aeTIos on May 28, 2012, 04:35:48 pm
My topic. :)
The difference is: On the nspire this game is easier to make due to the touchpad.
Title: Re: [Contest] Osmos
Post by: Nick on May 28, 2012, 04:38:32 pm
Wow, nice concept. It kinda reminds me of Flow (http://interactive.usc.edu/projects/cloud/flowing/), and it looks really fun :D

never heard of it, but flow is fun indeed (just tried it out), it indeed can remind you of it, it somehow has the same thing (i don't know how to call it xp )

and yeah, the touchpad is useful, but i'll add arrowsupport too in the future, since some people don't like the touchpad, which i can understand
Title: Re: [Contest] Osmos
Post by: Deep Toaster on May 29, 2012, 09:21:13 am
never heard of it, but flow is fun indeed (just tried it out), it indeed can remind you of it, it somehow has the same thing (i don't know how to call it xp )
Flow is an incredible time-waster. I guess it's something about transforming yourself from a tiny speck into a badass worm—like Spore (remember when that was a thing?). Osmos still looks like an original game though. Did you come up with the concept yourself? I like it.
Title: Re: [Contest] Osmos
Post by: leafy on May 29, 2012, 10:03:53 am
Nah, Osmos is actually a pretty cool iphone game that he cloned. Are you planning on adding gravity?
Title: Re: [Contest] Osmos
Post by: someone on May 29, 2012, 10:15:05 am
Osmos is a game that is already in the market, this is the official page:
http://www.hemispheregames.com/osmos/ (http://www.hemispheregames.com/osmos/)

And that game reminds me a bit to Bubble Tanks (http://www.kongregate.com/games/HeroInteractive/bubble-tanks)
Title: Re: [Contest] Osmos
Post by: Nick on May 29, 2012, 10:20:13 am
Osmos is a game that is already in the market, this is the official page:
http://www.hemispheregames.com/osmos/ (http://www.hemispheregames.com/osmos/)
this ^

and gravity?where should i add that? i could, if i knew where, since i haven't seen any gravity in ther (iirc)
Title: Re: [Contest] Osmos
Post by: leafy on May 29, 2012, 10:24:04 am
There's one level in particular, with a massive number of particles all in orbit around a "sun-like" osmo.
Title: Re: [Contest] Osmos
Post by: Nick on May 29, 2012, 10:27:22 am
oh that one, no.. the calculator can't handle that many calculations (in fact, it surely can, but in the way they implemented lua (==>slow) it's not possible)

so i'll just stick with these 4 and one additional that i will add in the next month (just a little different than these ones, and maybe a custom one i made myself). i would like to implement that sun-like system, but now the calc is already slowing down because it has to keep track of 40 cell instances/frame, which is nothing in comparison with the sun-like system xs
Title: Re: [Contest] Osmos
Post by: Jim Bauwens on May 29, 2012, 02:13:13 pm
What about the physics engine in 3.2 ? :D
Title: Re: [Contest] Osmos
Post by: Adriweb on May 29, 2012, 02:28:01 pm
Congrats Nick :D
Looking very good !

Also, using the Physics Engine with that kind of stuff is very fast (smooth)... :D (and not very bad at all on calc)
I may upload a video later today, just so you can see...
Title: Re: [Contest] Osmos
Post by: Nick on May 29, 2012, 02:30:18 pm
really? great :) then i could update it if i get used to the engine :)

is the new lua faster in general ?
Title: Re: [Contest] Osmos
Post by: Adriweb on May 29, 2012, 02:32:23 pm
Hmmm no, Lua itself hasn't changed...
Title: Re: [Contest] Osmos
Post by: kindermoumoute on May 29, 2012, 05:18:05 pm
Wow, I already played this game on android, but this port looks... awesome ! o_o
Title: Re: [Contest] Osmos
Post by: Nick on May 30, 2012, 03:04:39 am
thanks :)

i improved the AI for now, but i still seem to have troubles making the AI avoiding the cells.. sometimes it avoids them, but for some reason it shoots to it like hell ö i suppose there's something simple wrong, but i'll have to take a fresh new look at it

i also decided to go with less cells on the screen, but they will be bigger. This because:
     1) it gets a lot faster if i remove cells -->playablility (is that even a word) gets improved
     2) better overview
     3) looks better in general

new progress will come slowly (exams), but i'll get there..
i'll take another look at the sun-like system too, maybe it's possible with less cells, i'll see what i can do, it would be nice though
Title: Re: [Contest] Osmos
Post by: stevon8ter on May 30, 2012, 10:16:53 am
If you'dd finish the game and all of those functions in it, that would be nice
I'm gonna buy a ti nspire (where in belgium is that possible?) and play your game
Title: Re: [Contest] Osmos
Post by: Nick on June 01, 2012, 05:32:57 pm
here is the first show-off of Osmos running on Pscspire. as you can see it's not really optimized yet, but the screenfitting are working, and so are the buttons and the amount of cells in the game
i made it that way so that it can take any screensize, so you will all be able to play this on your pc/linux/mac or whatever you want :)

As you can see in the vid the code itself isn't totally optimized yet for the big screen (the cell don't move fluently but this is not the final version yet)

the vid lost most of its quality though while uploading, but you can see what's happening

I recommend  switching to full screen mode, since in this embedded video you won't see a thing over the look of how awesome it is :)

Title: Re: [Contest] Osmos
Post by: stevon8ter on June 01, 2012, 05:45:54 pm
Nice. I hope you keep working on it
Title: Re: [Contest] Osmos
Post by: Jim Bauwens on June 02, 2012, 05:45:58 am
Very nice, glad it is working properly :)

Also, it is PCspire not Pscspire :P
Title: Re: [Contest] Osmos
Post by: Adriweb on June 02, 2012, 06:27:46 am
Another demo showing how awesome PCSpire is :P
Title: Re: [Contest] Osmos
Post by: ElementCoder on June 11, 2012, 10:12:35 am
This is just awesome :D I love Osmos, great game. I can't wait till this gets released.
Title: Re: [Contest] Osmos
Post by: Nick on June 11, 2012, 02:54:38 pm
because of the exams development slowed down a lot.. in fact i haven't done anything since last update xp

i'll continue tomorrow, since then my biggest exams are finished, and i'll finally get some spare time again :)
also, I discovered that coding in the exams isn't really that relaxing ö especially debugging, it makes me nervous..
Title: Re: [Contest] Osmos
Post by: Jim Bauwens on June 11, 2012, 03:25:52 pm
Lol ^^

Also, if you code with PCspire or the new SDK it's more easy to debug :)
(You need to run PCspire from a console for that)
Title: Re: [Contest] Osmos
Post by: Nick on June 11, 2012, 03:29:01 pm
yeah, you told me to run it from the console, but nothing happened (well, it opened PCspire, but that's it..)

hmm, for the sdk i'll need to find my registration key first, and i don't really know where i left that xs so i'll look for it tomorrow.
i saw that there is a kind of console in the sdk, can you print to that using print() or how else?

it feels like i'll have loads of work to do tomorrow ö (not school related xp )
Title: Re: [Contest] Osmos
Post by: Jim Bauwens on June 11, 2012, 03:30:43 pm
Ah, I just checked. You need to add "--console" to the parameters of love in windows.
Title: Re: [Contest] Osmos
Post by: Nick on June 11, 2012, 03:36:46 pm
i tried it, and now it opens a console window, but the only thing it outputs is 'starting', nothing more..
twice btw, once the general scriptselectionmenu opens, and once the program opens

edit: wait, it's ok now, it only prints to the console when it crashes :)
Title: Re: [Contest] Osmos
Post by: Jim Bauwens on June 11, 2012, 03:41:57 pm
You can add a "-v" if you want more debug info.
Also, you can add print functions to your code, to debug stuff.

You get the "starting" twice, because the loader is actually an application too :D
Title: Re: [Contest] Osmos
Post by: Nick on June 11, 2012, 03:42:58 pm
yeah, i saw that in your code :) (yes i took a look in the code of PCspire too xp )

ok, nice, i'll check that out
thanks for making PCspire, it's really wonderful :)
Title: Re: [Contest] Osmos
Post by: Jim Bauwens on June 11, 2012, 03:45:53 pm
Ok :)

I'm glad it is useful, and it will become even better in the future.
Also, don't hesitate to report any function that doesn't work the same as on the TI-Nspire.
Title: Re: [Contest] Osmos
Post by: Nick on June 13, 2012, 10:53:39 am
UPDATE!!

i rewrote it totally, and now it uses more classes :)
new stuff:

that's about it.. it's getting finished :)
oh and you might see in the video that i did not yet make them better looking with that darker border, i might or might not add that in the future, we'll see (it all depends on the speed)

Title: Re: [Contest] Osmos
Post by: TheMachine02 on June 13, 2012, 10:55:04 am
great  :D  good work   :thumbsup:
Title: Re: [Contest] Osmos
Post by: Sorunome on June 13, 2012, 12:34:00 pm
Wha, that is looking nice!
Title: Re: [Contest] Osmos
Post by: Nick on June 13, 2012, 01:45:01 pm
thanks, although i optimized it, i seem to have a 'problem':

(http://img.removedfromgame.com/imgs/DSC00208.jpg)

as you can see, it only reaches 0.66 fps, which is terrible ö i really hope i get this number to rise, since now it's just frustrating xs

i had a mistake in my fps counter lol it's about 11 fps (which is still too low)
Title: Re: [Contest] Osmos
Post by: blue_bear_94 on June 13, 2012, 01:48:45 pm
Optimized for speed or size?
Title: Re: [Contest] Osmos
Post by: Nick on June 13, 2012, 02:04:25 pm
speed optimization, size optimization is a minor importance here (for now it's only 5kB) and the nspire has enough memory for size optimization not being such an important matter (at least not at 5kB)

with 6 cells, i can reach 20 fps, but that's too few cells :(
Title: Re: [Contest] Osmos
Post by: cyanophycean314 on June 13, 2012, 04:37:29 pm
The games all seem very fast. There was that one game where you spawned and had already won because no one else was bigger than you...  :-\

Size optimization is not an issue for Nspire Lua Programming. The biggest Lua program takes a little over 1 MB (Loulou's translator). There is over 100 MB available. If there's a size issue, it's probably the huge roms/wads/movies for your ndless programs.  :) That case is different for 8x dev though.
Title: Re: [Contest] Osmos
Post by: Jim Bauwens on June 13, 2012, 04:46:04 pm
Nick, don't forget to localize functions you use a lot. This can give a big speed gain.
Title: Re: [Contest] Osmos
Post by: Nick on June 13, 2012, 04:49:56 pm
localize functions ?? how can you possibly localize a function?
Title: Re: [Contest] Osmos
Post by: Adriweb on June 13, 2012, 04:53:25 pm
He means to make them local.

(not localized here as a language point of view)
Title: Re: [Contest] Osmos
Post by: Nick on June 13, 2012, 04:55:22 pm
i understand what he means :) i just don't know how..
Title: Re: [Contest] Osmos
Post by: someone on June 13, 2012, 06:33:43 pm
This link should help: LUA Performance (http://trac.caspring.org/wiki/LuaPerformance)
Title: Re: [Contest] Osmos
Post by: Nick on June 15, 2012, 04:58:20 am
thanks, but i've already done all that :)

i did a little testing, and it seems like those 12 fps is more than enough to play. i increased the speed of the cells with 2.5 and now everything is ok (they were moving at a speed between 2*10^-3 and 0.2 pixels per loop, that's why it seemed so slow)

the only thing now is that i never really thought about grayscale calcs xs the black antimatter cells are really hard to see on the dark blueish background in b/w, so i'll have to find a way to solve that. also the difference between blue and red cells is hard to see in b/w xs but that's a sorrow for later, i have to make it work first :)
Title: Re: [Contest] Osmos
Post by: lkj on July 08, 2012, 05:33:56 pm
The graphics are great, but on a b/w calc it's a bit too difficult. I think moving is a bit too expensive anyway.
And that it crashes most of the time if you press an arrow key is a bit annoying.

Don't get my wrong, I think this is a great game and I like it very much ;)
Title: Re: [Contest] Osmos
Post by: annoyingcalc on July 09, 2012, 05:29:37 pm
hmbug press the right arrow key, after you select intro and the game crashes, and btw fun game.
Title: Re: [Contest] Osmos
Post by: Nick on July 10, 2012, 12:32:22 am
well, it has an error for every arrowkey press and enterkey press that does not happen in the menu part.
since i simply forgot to remove 2 lines of code (or to add about 20) it throws errors, i know about it

thanks for telling me, and thanks for the comments
Title: Re: [Contest] Osmos
Post by: Jim Bauwens on July 10, 2012, 04:21:15 am
With Osmos on the calculator the initial moving speed is too slow, 1px/sec or something like that. This makes it less fun as you need to click a couple of times to move in a respectable speed (and losing lots of size). It works perfect in PCspire though .. :P
Title: Re: [Contest] Osmos
Post by: Nick on July 22, 2012, 05:40:11 am
hmm, i'll change that in a later version. i did not test it with PCspire, i actually never thought of that xs i just did it with the student software and my calc of course, and it was reasonable imo..

it's sad how there are two bugs in it, it's really stupid how i forgot these functions, but yeah, they will be gone in the newest version i will release :)
Title: Re: [Contest] Osmos
Post by: p2 on August 07, 2012, 11:39:49 am
Nick, you definitely played too much Spore!
Spore Galactic adventures or Spore Creatures? :D

But it looks really cool! ;)
Title: Re: [Contest] Osmos
Post by: Nick on August 07, 2012, 11:51:10 am
Nick, you definitely played too much Spore!
Spore Galactic adventures or Spore Creatures? :D

But it looks really cool! ;)

uh, what's spore? i don't know that xp
it's a clone of the real Osmos game, even the name is the same :)

but thanks anyway
Title: Re: [Contest] Osmos
Post by: p2 on August 07, 2012, 11:53:18 am

That's spore

OSMOS = call-stage in Spore



EDIT:
I just notices it:
SOMETHING'S MISSING!!
The cells don't have biig eyes!! 
 *.*  <-----that's how they should look like! ;)
Title: Re: [Contest] Osmos
Post by: Nick on August 07, 2012, 11:58:17 am
haha, cells with eyes :o

well, it's a totally different ganme though, the osmos i know (and cloned here) is a game on itself (an android app, but now also available as computer game)
Title: Re: [Contest] Osmos
Post by: p2 on August 07, 2012, 12:00:09 pm
well, cells, swimming around, eating each others and growing!
only the eyes are missing!
(I expect your cells to look CUTE with big baby-eyes!!!) ;) :D



EDIT:
I think I have to agree you're right: The goal in OSMOS is, to survive by not swimming too much and eating enemies. In SPORE, you need to eat them to become bigger AND to increase our own powers (speed, eaing plants, poisons, ...)
Title: Re: [Contest] Osmos
Post by: Nick on August 07, 2012, 01:03:32 pm
but actually the idea of eyes is not bad :) maybe i can add them to osmos, with a toggle function (so can choose to see or not see them yourself)
it'll slow it down even more though..
Title: Re: [Contest] Osmos
Post by: willrandship on August 07, 2012, 03:58:49 pm
Another major difference is that Osmos, at least the PC version, was very puzzle centric for a lot of the levels, where spore is more of an action game.
Title: Re: [Contest] Osmos
Post by: p2 on August 08, 2012, 01:54:33 am
Well, Spore is not really an action game!
It tells you the history of a single cell and lets YOU control it!
at the beginning, you are a cell.
later, you have laser guns and that stuff, thats right! ._.
Title: Re: [Contest] Osmos
Post by: Nick on August 08, 2012, 02:14:39 am
at the beginning, you are a cell.
later, you have laser guns and that stuff, thats right! ._.

so basically a cell with eyes shooting at other cells with lasers :o well, that's some nice cell xp
all those things slow down a lot, and for now it's already very slow (i could optimize it somehow though)
Title: Re: [Contest] Osmos
Post by: p2 on August 08, 2012, 02:20:40 am
so basically a cell with eyes shooting at other cells with lasers :o well, that's some nice cell xp
;D nice idea! But That's not what I ment!
at the beginning you're a cell
then you become an animal (leave the water)
then you're the leader of a tribe (fight against other tribes)
then you can build airplanes and cars (this is supposed to represent the present)
and in the last stage, you become the captain of a spaceship! ;)

and with "Spore - galactic adventures" you can also baem onto planets and complete missions - sometimes with nice weapons! ;)

Title: Re: [Contest] Osmos
Post by: Nick on August 09, 2012, 02:08:02 am
hmm, that sure is too complicated for me i guess.. but a cleaned-up version of osmos will surely come if i find the time and motivation to finish speedX3D :)
Title: Re: [Contest] Osmos
Post by: willrandship on August 09, 2012, 08:20:06 pm
Yeah, porting an accurate version of spore would not be easy :P
Title: Re: [Contest] Osmos
Post by: leafy on August 09, 2012, 11:23:28 pm
I think this game is fine as is. if you want eyes, make another game :P
Title: Re: [Contest] Osmos
Post by: Nick on August 10, 2012, 05:51:46 pm
I think this game is fine as is. if you want eyes, make another game :P

thanks, that might probably be a good idea :)