Author Topic: [Nspire] Pokémon Fuchsia -- An experiment  (Read 14340 times)

0 Members and 1 Guest are viewing this topic.

Offline hoffa

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 322
  • Rating: +131/-13
    • View Profile
[Nspire] Pokémon Fuchsia -- An experiment
« on: May 31, 2011, 12:11:08 pm »
Hey,

I yesterday started experimenting with Lua to see how well it handled graphics and other game-related stuff. I wrote on the other thread about my results. Well it seems like the calculator is not fast enough to handle games where fluidity in the gameplay is an important factor (i.e. many platformers). It's not that the calculator itself is slow, it's just the way Lua has been implemented on it that makes it inefficient for such games (Edit: invalidate() is able to update the screen partially, so all that written before might be wrong). I then decided playing around with Pokémon-like games, where speed is not the most important thing. And that's basically where I'm at, at the moment. For now with what I have done it seems to be working well. This also helps me to test Lua in a "real-life situation", with title screens and everything that a game usually has, in order to see what the difficulty of making such a game is and whatnot.

Everybody loves screenshots, so I give you screenshots:



It's not much (at least Ash can move and the basic tile "engine" is done), and I'm only in the experimenting/testing phase right now. I still have to see how to actually save an eventual game (it might be possible to do something with var.store() and its friends), if it is even possible, and many other things to see if it's even worth trying to make the game.

Spoiler For Spoiler:
It's Fuchsia because I didn't even know what kind of color fuchsia was, and also because it's such a manly color. (I don't even know how you pronounce "fuchsia")

That's it for now. :)

PS: Also notice the small black on the second screenshot at the bottom. By "removing" 4 pixels (which is the same width as the upper bar, so it's symmetrical and doesn't look ugly) I have a resolution of 318*208, which is a lot better (especially in a tile-based game) than normally.
« Last Edit: January 29, 2013, 10:55:08 am by hoffa »

Offline Spyro543

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1189
  • Rating: +74/-3
    • View Profile
Re: [Nspire] Pokémon Fuchsia -- An experiment
« Reply #1 on: May 31, 2011, 01:23:55 pm »
Looks awesome! I'll be getting an Nspire, hopefully. I hope you will continue, looks awesone!

Ashbad

  • Guest
Re: [Nspire] Pokémon Fuchsia -- An experiment
« Reply #2 on: May 31, 2011, 01:40:14 pm »
that looks great Hoffa!  I heard that graphics rendering for Lua is a slow stack-based method (For NLua, at least) -- what is the framerate right now?

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: [Nspire] Pokémon Fuchsia -- An experiment
« Reply #3 on: May 31, 2011, 02:12:07 pm »
That looks nice. If I was you however, I would start with a small Pokémon demo with only like 20 Pokémons maybe to not start too big. That's unless you have a lot of project and programming experience, though. I guess maybe there will be no smooth scrolling, right?

Fortunately Lua speed is better than nothing at least. It seems we can do pretty awesome stuff in it and the slow speed might encourage people to try finding new optimizing tricks in the process.

Offline hoffa

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 322
  • Rating: +131/-13
    • View Profile
Re: [Nspire] Pokémon Fuchsia -- An experiment
« Reply #4 on: May 31, 2011, 02:14:47 pm »
that looks great Hoffa!  I heard that graphics rendering for Lua is a slow stack-based method (For NLua, at least) -- what is the framerate right now?
I can't really say as there is no real animation. It's also event-based so unless I make some sort of benchmarking thing with continuous animation it'll be hard to give an accurate framerate. But I'd say about 10-15 FPS, but it can be anything really.

Offline hoffa

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 322
  • Rating: +131/-13
    • View Profile
Re: [Nspire] Pokémon Fuchsia -- An experiment
« Reply #5 on: May 31, 2011, 02:18:43 pm »
That looks nice. If I was you however, I would start with a small Pokémon demo with only like 20 Pokémons maybe to not start too big. That's unless you have a lot of project and programming experience, though. I guess maybe there will be no smooth scrolling, right?

Fortunately Lua speed is better than nothing at least. It seems we can do pretty awesome stuff in it and the slow speed might encourage people to try finding new optimizing tricks in the process.
What I really wanted to try here wasn't that much the Pokémon part, but the tile-based-game part. I'm not even thinking about the Pokémons and fights yet, just about how it would all work and checking the performance and stuff like that. When it comes to the slow speed, the problem is that if the most primitive functions are already slow, it'll be hard to optimize that.
Edit: about scrolling, well I think that kind of smooth scrolling you have on Pokémon would be hard and/or laggy. Insted what could be possible is the kind of Zelda-like "fake" scrolling (as on the NES version). But anyway, the screen is quite big and quite many sprites fit on it, so I don't think it will be a huge problem.
« Last Edit: May 31, 2011, 02:27:41 pm by hoffa »

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: [Nspire] Pokémon Fuchsia -- An experiment
« Reply #6 on: May 31, 2011, 02:20:29 pm »
Great job ! It looks really great :)

By the way, when we documented the lua functions when we discovered them, we didn't know platform.window:invalidate() would accept arguemtns that specify *what part of the screen" you want to refresh.
This is really interesting since it can refresh the screen much faster then on the parts that change, and leave the screen as is when it doesnt need to get refreshed. Maybe  it will work better for your other experiments ?
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation

SirCmpwn

  • Guest
Re: [Nspire] Pokémon Fuchsia -- An experiment
« Reply #7 on: May 31, 2011, 02:31:56 pm »
Looks quite nice!
Also, try to avoid double posting in the future, and simply modify your post with new information.

Offline hoffa

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 322
  • Rating: +131/-13
    • View Profile
Re: [Nspire] Pokémon Fuchsia -- An experiment
« Reply #8 on: May 31, 2011, 02:32:27 pm »
By the way, when we documented the lua functions when we discovered them, we didn't know platform.window:invalidate() would accept arguemtns that specify *what part of the screen" you want to refresh.
Goddamn, are you serious?! :o That's great news! That could fix many (if not all) of the framerate issues! I have to try that out, thanks for telling me that! :D That will help a lot.

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: [Nspire] Pokémon Fuchsia -- An experiment
« Reply #9 on: May 31, 2011, 02:33:40 pm »
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation

Offline hoffa

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 322
  • Rating: +131/-13
    • View Profile
Re: [Nspire] Pokémon Fuchsia -- An experiment
« Reply #10 on: May 31, 2011, 02:43:29 pm »
That's why I told you ;)

It's there : http://wiki.inspired-lua.org/platform.window:invalidate
This is so great. Just tried it out, Ash now moves faster than light (well you get the point). Having a lot of stuff on the screen might not be an obstacle after all!

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: [Nspire] Pokémon Fuchsia -- An experiment
« Reply #11 on: May 31, 2011, 02:44:36 pm »
Glad it improved your things :)
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: [Nspire] Pokémon Fuchsia -- An experiment
« Reply #12 on: May 31, 2011, 03:31:47 pm »
Are you planning to eventually release the source code? It would be nice for people who wants a tilemapper :D

Offline hoffa

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 322
  • Rating: +131/-13
    • View Profile
Re: [Nspire] Pokémon Fuchsia -- An experiment
« Reply #13 on: May 31, 2011, 03:42:42 pm »
Are you planning to eventually release the source code? It would be nice for people who wants a tilemapper :D
Sure! This is what I have at the moment: http://pastebin.com/phnSAjKH (there's not much to see at the moment, I'll post the code again once I have cleaned it up and have some more interesting things. Edit: also there are things I still need to optimize, for example now it will redraw all the objects on the screen at every call at on.paint(), etc.)

Edit: new cleaned up and more consistent code: http://pastebin.com/0HPsh4vy
« Last Edit: May 31, 2011, 04:59:06 pm by hoffa »

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: [Nspire] Pokémon Fuchsia -- An experiment
« Reply #14 on: May 31, 2011, 03:45:17 pm »
Cool to hear. A good spot to upload it when completed might be the Lua sub-forum on the site and also the Nspired-Lua wiki :D