Join us on Discord!
You can help CodeWalrus stay online by donating here.

WalrusRPG - a cross-platform J-RPG engine

Started by novenary, November 17, 2014, 07:00:20 PM

Previous topic - Next topic

0 Members and 10 Guests are viewing this topic.

Duke "Tape" Eiyeron

I hate touchscreen keyboards. I meant that having buffers to manage each layer independently from their positions is only useful when managing one layer animations.
  • Calculators owned: A lot.

Dream of Omnimaga

Quote from: Streetwalrus on November 28, 2014, 08:55:58 AM
the layers just render to the same buffer. It would be silly to render them separately.
Oh ok I thought you needed them separate for when characters walk behind trees, houses, etc.
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

novenary

We can just draw one tile on top of the character in that case.

matrefeytontias

I had an idea to reduce the amount of sprites drawn. If I understand correctly, you draw the whole tilemap once for each layer ? If yes, only draw what's certain to be visible on-screen (I know you already do that, but it doesn't hurt to remind it). Then, I see from your code that you draw tiles regardless of their layer level ; no wonder that you draw > 300 sprites each frame. So here's what I propose :

Basically, have each tile be a structure, ordered like so :

typedef struct
{
    uint16_t **imgs; // or a reference ID if you have a big map, but this makes it so you don't need lookup as much
    int usesLayer[MAX_LAYERS]; // ints are much faster than anything else on Nspire ; you should remember this for the future
    // maybe more, what do I know
} tile_t;

The trick is that usesLayer is an array of boolean values. To use that, you'll have to modify your map drawing a bit : you must know exactly what layer you're currently drawing, that way you can just test the corresponding entry in the usesLayer array of every tile_t structure you've got  and ignore them if you find a 0 value. That should actually cut off more than 50% of the drawables, since most of them aren't animated (correct me if I'm wrong).
  • Calculators owned: TI-83+.fr, TI-Nspire CAS prototype, TI-84+ CSE, TI-Nspire CX
My TI games (some got their own article on non-calc websites !) : http://www.ticalc.org/archives/files/authors/112/11202.html

My moozik (100% free metal) : http://www.soundcloud.com/matrefeytontias

novenary

Hmmm, I removed the multi layer code for now but I actually test if a tile is 0 (transparent) on the upper layer which greatly speed up rendering but it does slow down if there are many tiles on them.

TIfanx1999

I remember chatting with you guys about this project on HCWP a few weeks ago. It's a really ambitious project, and I'm really interested to see where it goes. :) Can't wait to see some screens.

novenary

I should make an animated screenshot of the current tilemapper. Need to find more awesome ways to make it faster too.

Dream of Omnimaga

If you pre-render an entire map then only draw a 320x240 area of the resulting large pic, is it much faster? On the Prime that seems to be the way to do it in order to gain speed, else you can shift the screen content then draw the missing row of tiles, although it's harder.
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

aetios

I wonder what everyone wants to see first? Also, I probably will need help with spriting. I can only do so much, especially with college up my back.
ceci n'est pas une signature

Dream of Omnimaga

Maybe start with battles first to ensure you can pull such thing off and work on the menu. Make sure to plan variable management ahead, though.
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

novenary

Quote from: DJ Omnimaga on January 03, 2015, 11:11:21 PM
If you pre-render an entire map then only draw a 320x240 area of the resulting large pic, is it much faster? On the Prime that seems to be the way to do it in order to gain speed, else you can shift the screen content then draw the missing row of tiles, although it's harder.
Well, it's definitely an insane amount faster to do, but it would require insane amounts of ram. So much that I may need to kill TI os at one point. Besides it's already been discussed. :P
Also variable management is a non issue in c. Since you give names to every variable, and you have an unlimited amount you can do it more easily.

Dream of Omnimaga

Yeah, on the HP Prime, using pictures this large seems to cause stability issues. <_< That said I found an alternate solution in my case which I'll post in my SWL thread.


As for variable management, I meant you should make sure to comment the code or a txt plan file so that you can remember what each variable did in the future, should you take a very long break from this project. Even with names it can still get confusing when you have 100-200 variables.
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

aetios

Yeah I make sure to comment every variable and everytime I come back I check if I still understand what stuff does and if I don't I figure it out and improve the description.
ceci n'est pas une signature

novenary

Hmmm functional programming really helps. I use self-explanatory function and variable names, and there's not many variables per function so it's easy enough.

novenary

THE GAME
I'm picking this back up. I'm currently in the process of refactoring the engine in order to streamline development. Considering switching to C++. Eiyeron is helping me now and is going to contribute to the code.

The name was changed to WalrusRPG because this is no longer a Pokemon clone (until further notice :P). New repo URL : https://github.com/Streetwalrus/WalrusRPG.

Powered by EzPortal