You can help CodeWalrus stay online by donating here. | New CodeWalrus | Old (dark mode) | Old (light) | Discord server

WalrusRPG - a cross-platform J-RPG engine

b/Calculator Development Started by novenary, November 17, 2014, 07:00:20 PM

Previous topic - Next topic

0 Members and 13 Guests are viewing this topic.

u/Duke "Tape" Eiyeron November 28, 2014, 12:05:53 PM
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.
u/Dream of Omnimaga November 28, 2014, 05:02:22 PM
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.
u/novenary November 28, 2014, 07:55:32 PM
We can just draw one tile on top of the character in that case.
u/matrefeytontias December 01, 2014, 07:19:03 PM
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).
u/novenary December 01, 2014, 07:43:59 PM
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.
u/TIfanx1999 January 01, 2015, 09:34:38 PM
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.
u/novenary January 03, 2015, 11:09:53 PM
I should make an animated screenshot of the current tilemapper. Need to find more awesome ways to make it faster too.
u/Dream of Omnimaga 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.
u/aetios January 05, 2015, 11:44:20 AM
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.
u/Dream of Omnimaga January 05, 2015, 05:06:39 PM
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.
u/novenary January 06, 2015, 08:41:07 AM
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.
u/Dream of Omnimaga January 06, 2015, 06:24:17 PM
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.
u/aetios January 09, 2015, 10:54:22 AM
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.
u/novenary January 09, 2015, 11:01:10 AM
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.
u/novenary April 30, 2015, 01:06:08 PM
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.
Website statistics


MyCalcs | Ticalc.org | Cemetech | Omnimaga | TI-Basic Developer | MaxCoderz | TI-Story | Casiocalc.org | Casiopeia | The Museum of HP Calculators | HPCalc.org | CnCalc.org | Music 2000 Community | TI Education | Casio Education | HP Calcs | NumWorks | SwissMicros | Sharp Calculators
Powered by EzPortal