Omnimaga

Calculator Community => Other Calc-Related Projects and Ideas => TI Z80 => Topic started by: Eiyeron on August 15, 2013, 11:10:00 am

Title: [C /axe?] Hinawa Battle Engine
Post by: Eiyeron on August 15, 2013, 11:10:00 am
Hinawa Battle Engine


[CONTENT IN PROGRESS]

Keys:
(http://geekbros.tk/~eiyeron/screenshots/HBE%20Capture%202.gif)
Title: Re: [Axe] Mother3?
Post by: TIfanx1999 on August 15, 2013, 11:20:11 am
This looks great so far! :D
Title: Re: [Axe] Mother3?
Post by: DJ Omnimaga on August 15, 2013, 03:02:30 pm
Wow you really want to make a Mother clone for calcs? It would rule! O.O

Anyway good luck because RPGs are long to make. Make sure to optimize as much as possible to get around code limits (including making as many things as possible into data rather than being hard-coded).

Also will the title screen background style be used in battles like the weird backgrounds there were in the original games?
Title: Re: [Axe] Mother3?
Post by: Eiyeron on August 15, 2013, 03:31:08 pm
Olà, we're thinking about 5MHz calcs!

Why not... But ill be *very* slow, since I can't get a decent speed because Text() is used a lot...

It sure'll be a long-term project, this game has a cr*pload of numbers for a simple ennemy (status ailment resistance for instance)...

EDIT: DJ_O, I just got what you meaned. Also, why not? It won't be the only one animation, that would be repetitive...

EDIT2: Finally I added a grayscale background. Gray and white.

I'll need a lot of space, I'd like to have 32*32 ennemy sprites, and with background mask and 2 facing (front and back), that takes 512 bytes/enemy...
Title: Re: [Axe] Mother3?
Post by: DJ Omnimaga on August 16, 2013, 07:41:25 pm
There are no 5 MHz calcs ???

And I see. Text can definitively be slow since TI's routines suck x.x. I wish that Axe actually used a custom text routine lol.
Title: Re: [Axe] Mother3?
Post by: Eiyeron on August 17, 2013, 04:48:16 am
5MHz or whatever ( a monster is named Whatever, it's quire funny).

I saw an Axiom somewhere... I'll dig into it...
Title: Re: Re: [Axe] Mother3?
Post by: DJ Omnimaga on August 17, 2013, 12:19:43 pm
Else you can just use sprites to display text as a custom font routine, which would be way faster. Else, the best way is to ensure that as less text as possible have to be displayed every frame.
Title: [Axe] Hinawa Battle Engine
Post by: Eiyeron on August 17, 2013, 12:23:55 pm
Yeah, I still trying to avoid taking too much place at the moment. It's only the bqttle engine and still It uses 2500 bytes...

Anyway, I refactored a little my code, and it has dynamic sprite pointers! The background sprites doesn't take any static pointer.

I did some UI works, but not still not much to earn interest...

EDIT: I decided that I'll make only the battle engine first, and named it Hinawa. I updated a new version of the demo, (still not a functionnal battle core), with gray backgrounds, speed up HUD (forgot to put back the names), and a forst attempt at UI designing.

Press EXE to show the PSI box, and Shift to change background animations.

To do text sub-routines made me rework on hud routine, because I already used registers in tje Hud, and that made a huge less, and almost erase the main source. So I backed up the version's source you have here.

How should I use variables? Global A-Z? Stored in a list depending of the context?... I'm a bit lost here.
Title: Re: [Axe] Hinawa Battle Engine
Post by: TIfanx1999 on August 17, 2013, 03:37:01 pm
Those backgrounds look really great Eiyeron! :D
Title: Re: [Axe] Hinawa Battle Engine
Post by: Eiyeron on August 18, 2013, 04:26:44 am
It's mainly sprite drawing/generating.

The first is just blitting columns of the same sprite, but the second is more interesting : I'm generating a sprite on-the-fly. I was inspired from xor texture, but couldn't grasp the true form of it in a B&W screen, I remebered of the munching squares demo. It's principally the same mecanism, but animating it is more easier and fun.

Spoiler For Images of Xor Textures and Munching Squares:
(http://lodev.org/cgtutor/images/xortexture.gif)
Xor texture, mainly used in pmaceholder texture, bevause easy to generate
(http://mathworld.wolfram.com/images/eps-gif/MunchingSquares_1000.gif)
(http://mathworld.wolfram.com/images/gifs/munchsq.gif)
Munching Square!

EDIT : Some news. I have to take a lot of informations in the original Game.
Here what I know:
-GBA data is little endian. That make resd the data easier... (In fact no)
-Xp caps are 32-bit encoded, in little endian. 100 levels/character... :D
-Stats are semi-random : with each level we have different and random stats bonus. Eqch 10 levels the game tries to adjust your stats to a predfined stats stored in data... Yup, I need to collect 10*6 stats/character.
-PSI learning table...
-I get more or less 324 bytes to collect and understand per character.
-Line/move/IA databasrs planned... That's again a lot of data... :/
Oh, and I use now the Text Axiom. I certainly use Pucrunch too. There is a lot of data in this game. FYI the original game barely stays in a 32MB cartridge, the max for a GBA. And it's mostly compressed... Imagine what could they do if they had to do M3 on a 128MB DS cartridge, or 8GB 3DS one!

I'm planning on 24*24 sprites max for monsters, more animated backgrounds (certainly a fire for the third), But for now, I'll start on rolling meters, the main part of the battle engine.

I played again the game, and I noted some near things with these rollers, here is the most interesting:
Some ennemies are littlrally livings bombs-on-legs, and explodes dealing generally mortal damage, but there isn't enough time for our players to die because once the message "YOU WON" is displayed, the odometers stop instantly, even if you litteraly were blown off...

I hope a day playing a lot with this engine. I love how thr odometer add a stressing critical strategy core.

Oh, and what pc/calc tool is available for 24*24 sprites? (Preferably with 8*8 chunks, thanks)

EDIT 2: I started working on game logic (UI and key reaction), It's quite hard and new, because there are only non-modal UI, I need to constantly update game state, not only UI logic. So I started working on the game structure, and that seems quite nice at the moment. I can "select" bash, guard and PSI for character that have the right options... Only the dialog box is shown when  selecting PSI. I need simple stats and at least an ennemy to be fully capable of correctly working...

EDIT 3: I'm now, at this moment, getting some data. I'm getting level stats, and experience level curve. Little endian, so reversed. RomHacking, here I come.
Title: Re: [Axe] Hinawa Battle Engine
Post by: Eiyeron on September 14, 2013, 04:47:24 pm
To give some news, I'm still developping that. I redesigned the menu boxes to expand the top bar (it looks niver that way, less like Mother 3, but hey! It's my engine), I added a dynamic sprite routine, optimized two of the three battle backgrounds. But one feature at once.

The menu boxes and the top menu share the same drawing routine. The menu for PSI selection is begun, and the top bar is fixed and the drawing routines are optimized (use of Copy which I forgot).

The monsters will use a rutine that I'm proud of. THeir sprites are stocked and *compressed* into 8*8 chunks with RLE-indexing. FOr instance Mr Batty in grayscale only have 12/13 sprites (don't remeber the exact name) for each of the buffer and the mask, so 36/39. FOr a 35*35 sprite, that's cool.

The backgrounds got a lil optimisation I stole from DJ_Omnimaga and his Super SOnic Ball : copying the background top rows to the rest of the buffer is way faster than just spriting it.
This engine won't enjoy the GrayLib grayscale, because it's way too CPU-expensive (~70% of the CPU is used for the interrupt...)...
I'm still doing that, don't worry guys! Screens will be added later. For Omnom!

EDIT: Say HI to Mr Batty! I forgot to telle precisions to the key deobuncer/polling. It's just anarray which includes keys states. It's updated when your run the routine UKEY(). There is 4 states; Up, Down, Pressed (the instant where the key is pressed), and Released(the instant where the key is released). NO more instant key repeats!
Title: Re: [Axe] Hinawa Battle Engine
Post by: Sorunome on September 15, 2013, 07:25:26 am
That sure is looking epic O.O
Title: Re: [Axe] Hinawa Battle Engine
Post by: TIfanx1999 on September 16, 2013, 06:40:56 am
That sure is looking epic O.O

You took the words right out of my mouth. ;D
Title: Re: [Axe] Hinawa Battle Engine
Post by: Eiyeron on September 16, 2013, 09:42:27 am
Bad News: I have to find best optimisations because it's unplayablenwithout Full...
Title: Re: [Axe] Hinawa Battle Engine
Post by: TIfanx1999 on September 16, 2013, 10:24:38 am
Hopefully, you can figure something out. If not, well... using Full isn't the end of the world. Maybe you can post a help topic asking for optimization help. :D
Title: Re: [Axe] Hinawa Battle Engine
Post by: Eiyeron on September 16, 2013, 11:20:54 am
Hopefully, once I made enough progress I'll release the source code! It's an engine, remember
Title: Re: [Axe] Hinawa Battle Engine
Post by: Eiyeron on September 26, 2013, 01:53:04 pm
Got some coding time today! I refactored a big chunck of code to split data and code, and started to store player's stats. Now all the code based on players and fixed data are now only based on player's real values. If you change the skill typeof your player, the menu will change, if you change the id, it'll change his name!

EDIT : Meh, I really need to reinstall wabbit and TILP here. But here is some plans : I'll try to add PSI for the characters. But if you want some techinal details , here is the actual player structure:

[ID,Skilltype] : 2*1 bytes
[HP Target, HP] = 2*2 bytes
[PP Target, PP] = 2*2 bytes
[Att, Def] = 2* 2 bytes
[Spd][LVL?] = 2*1 bytes

A character takes 16 bytes.
Title: Re: [Axe] Hinawa Battle Engine
Post by: Streetwalrus on September 28, 2013, 06:51:03 pm
Nice to see this progress. I like the concept of this engine, it's different from pure turn based. :)
Title: Re: [Axe] Hinawa Battle Engine
Post by: Eiyeron on September 30, 2013, 07:19:37 am
It's freaking good! During the NKC battle, I saw that waiting for the rolling meter to reach its target is useless, the target HP/PP is always changed, not the rolling value.

(Dude, I love the NKC, its battle is sooo epic with that music)
Title: Re: [Axe] Hinawa Battle Engine
Post by: break on October 01, 2013, 10:49:23 pm
@Eiyeron

wow...this is looking fa-nominal !!

* keep up the great work *

i'll continue to support this project  ^_^"
Title: Re: [Axe] Hinawa Battle Engine
Post by: Eiyeron on October 02, 2013, 02:24:01 am
Haha Thanks! ^^
Next thing I'll add Mr. Batty's stats, and I'll try implementing bashing.b But no combo for now.

EDIT : Wow (http://earthboundcentral.com/2013/10/mother-3-calculator-edition/) *.*, I have to finish it now!
Title: Re: [Axe] Hinawa Battle Engine
Post by: Sorunome on October 03, 2013, 04:16:05 am
Congrats for http://earthboundcentral.com/2013/10/mother-3-calculator-edition/ :P

EDIT: Dang it Eiyeron for ninja-edit >.<
Title: Re: [Axe] Hinawa Battle Engine
Post by: Eiyeron on October 03, 2013, 04:18:43 am
Yay! I became popular! Yay, I don't frigging know how to react to this! (Younger, I was quite shy)./me starts to freak about his own decisions.
Title: Re: [Axe] Hinawa Battle Engine
Post by: TIfanx1999 on October 03, 2013, 05:16:07 am
Hey, be happy Eiyeron. :) and congrats! I wonder how they found out about this?
Title: Re: [Axe] Hinawa Battle Engine
Post by: Eiyeron on October 03, 2013, 05:23:13 am
I don't remember talking about HBE somewhere else than here. Nor twitting about this...

But just google "Mother 3 battle engine"...
Title: Re: [Axe] Hinawa Battle Engine
Post by: Sorunome on October 03, 2013, 06:07:07 am
ha, nice, google is stalking you :P
Title: Re: [Axe] Hinawa Battle Engine
Post by: TIfanx1999 on October 03, 2013, 08:13:37 am
Hmmm. This topic is the sixth entry in Google for me.
Title: Re: [Axe] Hinawa Battle Engine
Post by: Eiyeron on October 03, 2013, 02:24:22 pm
Ah right, Google is editing our search results on per user basis.
Title: Re: [Axe] Hinawa Battle Engine
Post by: Sorunome on October 03, 2013, 02:30:11 pm
for me it's also around 6th :)
Title: Re: [Axe] Hinawa Battle Engine
Post by: DJ Omnimaga on October 09, 2013, 01:31:45 am
Congrats eiyeron :D


By the way for battle backgrounds, in the past there are people who did special effects by using bugs they ran into at their advantage. For example, see Snake 84C title screen where the logo is screwed up or the random lines that sometimes appears through Super Sonic Ball title screen. :P Or in other cases such as just reading through RAM and copying the next 768 bytes into L3 to create a grayscale sandstorm effect. :P
Title: Re: [Axe] Hinawa Battle Engine
Post by: Eiyeron on October 09, 2013, 03:16:15 am
I'm plannin first to manage turns and acitons, then I'll work into porting at least one earthbound-esque bg animation
Title: Re: [Axe] Hinawa Battle Engine
Post by: Eiyeron on October 28, 2013, 06:56:17 am
Just letting this here...Did it myself (http://luafx.free.fr/Misc/bg.7z)

EDIT : Got some news, I implemented a action choice start, it stores correctly the actions. I coded a little more the PSI attack choice, and greatly optimized the source (more than 100 bytes won, monsters sprites taking less place, enemy routine drawing GREATLY optimized!) The game still suffers from slow speed on 83+, but it's better than before.


EDIT2: I added a poll to know if anyone is interessed to see the source code to see where I am, or help me. In fine, this engine will be released, and open source. It'll be an early release if enough people want to see it.

Edit 3: Can someone give me some level 10 stats for the quatuor?
Title: Re: [Axe] Hinawa Battle Engine
Post by: Eiyeron on January 25, 2014, 01:57:35 pm
NECROBUMP!!

I finally stopped to messa round and gone into the deep and complet part of turn actions. I implemented a text box routine and I'm  trying to deal with it and turn reactions,, like death of a character. But it's way complex and delicate than I thought and I need to redesign more or less all the mechanism :/
Title: Re: [Axe] Hinawa Battle Engine
Post by: DJ Omnimaga on January 29, 2014, 12:43:53 am
Sorry to hear D:, glad this is still alive, though. I can't help, though, because I have stopped Axe and haven't coded a full RPG in almost 9 years D:
Title: Re: [Axe] Hinawa Battle Engine
Post by: Eiyeron on February 14, 2014, 01:49:55 am
Got some neeews. I adopted a similar yet more functional methodology to program and it seems to run quietly fine. Yet text routines have to implemented again, but this weekend I'll show you the text box routine in a separated demo. It's quite modulable.

You have three routines:


You can run Utext in a loop until it reached the end of the text or if the buffers are filled, or you can run and draws them for each character. I'll take the second because i'll maybe implement custom character codes for reactions or effects (slowing the text flow, shake, whatever you want it'll implement the functions you want with some function pointers).

I have yet to make sure my code is cleaner than before and more understandable than ever. Textboxes litteralt breaks the battle flow and can be quite hard to manage, specially when characters dies/KOes (the rolling meters still roll when in a textbox, that's the hardest thing to manage in this engine)
Title: Re: Re: [Axe] Hinawa Battle Engine
Post by: DJ Omnimaga on February 16, 2014, 02:38:52 pm
What would be cool is if you could do like in my no-longer available ROL4 text box engine and allow the user to change the window borders in the options. :D
Title: Re: [Axe] Hinawa Battle Engine
Post by: Raylin on February 16, 2014, 03:21:29 pm
Feel free to use some of my old Noah sprites.

(http://i.imgur.com/fR8Q9HY.png)
Title: Re: [Axe] Hinawa Battle Engine
Post by: Eiyeron on February 17, 2014, 02:28:09 am
Feel free to use some of my old Noah sprites.

(http://i.imgur.com/fR8Q9HY.png)
Nice work! I looks a lot like Lucas!

What would be cool is if you could do like in my no-longer available ROL4 text box engine and allow the user to change the window borders in the options. :D
There aren't any borders at the moment, I use the top border drawing routine as the text box border, it's just moved down to make place for the text.
Title: Re: [Axe] Hinawa Battle Engine
Post by: chickendude on February 17, 2014, 03:56:08 am
Any screenshots coming up soon? :D
Title: Re: [Axe] Hinawa Battle Engine
Post by: Eiyeron on February 17, 2014, 07:17:41 am
The main problem is nothing have been added graphically. I can pop out another screenie, but heh, you'll don't see much more. ANyway, I said I would do the text box engine, maybe this evening.
Title: Re: [Axe] Hinawa Battle Engine
Post by: Eiyeron on April 24, 2014, 12:57:08 pm
Three months later, I got a game engine revelation : I'll drop real-time death detection for a "final blow". I'm not sure how I'll use it, certainly something like a multiplier based on Guts at damage/recovery calculation and then the characther will fall. Now I need to balance, so much abuse is possible with such last stand chance (like recoverying each time at 0 hp...)

To sum up : the counter will flow naturally to 0, and once it reachs 0 and with some event, the charatcer will be given a last chance final blow. Else it'll collapse at its turn. And now I just obliterated an difficult obstacle by not overcoming it! \o/
I'll maybe go into the source later. DOn't expect something but I'm interessed again in the game engine.
Title: Re: [Axe] Hinawa Battle Engine
Post by: TIfanx1999 on April 26, 2014, 07:51:23 pm
\o/ Glad to see you have some interest in this project again. :D
Title: Re: [Axe] Hinawa Battle Engine
Post by: Eiyeron on May 06, 2014, 02:45:48 am
What I decided during this time:
- Managing the death in real time is quite hard and I do'nt really know how I will manage this. I'm gonna take this slightly different from the original games.
- I need to plan more things
- Gonna make some real documentation.
- I need a better way to code on computer. At least dig into the last zStart version.


What I expect :
- The engine taking too much space. Having an engine totally apart of a hypothetical RPG engine is quite bizarre, right? Having to arhcive things before running something else and getting the data back can be quite problematic (and prone to Garbage Collect).
- Need more power. I need to keep the source code as clear as I want to keep it. Thus optimization is quite unneeded as long I want to expand the code.
Title: Re: [Axe] Hinawa Battle Engine
Post by: TheCoder1998 on May 06, 2014, 03:19:58 am
just wanted to say that this looks pretty awesome :D
Title: Re: [Axe] Hinawa Battle Engine
Post by: Eiyeron on May 06, 2014, 03:34:15 am
Thanks! For extra information, it started at a "proof' of concept for dynamic background in modal menus.

Having to check death made a big conditionnal and as i didn't finished the structure itself it gave me some big problems. i almost lost track of what's done in the code...
Title: Re: [Axe] Hinawa Battle Engine
Post by: Eiyeron on May 10, 2014, 06:54:05 am
You want good news, here is some good news: I found a way to implement text routines in the engine! It blocks the battle state unless the text has finished appearing. I need now to remember how I'll implement multiple line text, multiple part text and figure what my code does in some places. For now, a stupid string appears "before" the enemy attacks, but it attacks just before the text. I guess that code chunk with random is the placeholder for damaging the players.

You want bad news? No? Here are we bad news: I reached 6200 bytes.
Edit: multiple lines and screens are correctly managed and the text update is pause at each line end! You can read the text at the rythm you want! -(//)-(//)
Title: Re: [Axe] Hinawa Battle Engine
Post by: Hayleia on May 10, 2014, 07:27:04 am
I am just popping in to tell why I voted for "yes" in your poll. You say that you reached 6200 bytes. and if you want to save space, obviously optimization is the way to go. But optimization is not (only) something that you do at the end, there are some things that should be automatisms, and (I don't know if you know them but if you don't) if you want to learn some, you might want to provide the source so people can help ;)

Also, not about optimizations but there are also some ways of coding that help you code faster. For example, if you only use variables with names that don't mean anything, after a week of break the only thing you can do is start over because you don't understand anything to your code anymore :P
So once again, if you don't know them and want to learn, people can help :)
Title: Re: [Axe] Hinawa Battle Engine
Post by: Eiyeron on May 10, 2014, 07:28:41 am
At least I let some explanation behind the variable definitions!,:p But in contex, I can remember what a variable does here and there. That's just creepy to read cryptic code and  remember its usage.
Title: Re: [Axe] Hinawa Battle Engine
Post by: Hayleia on May 10, 2014, 07:30:13 am
Yeah, don't worry, I was not saying "give the source code or die" because I almost never provide the source code myself :P
This was just a "why it can be a good idea", and I can understand arguments against :)
Title: Re: [Axe] Hinawa Battle Engine
Post by: Eiyeron on May 10, 2014, 07:32:39 am
Actually I'm OK with releasing source code. If well explained that becomes a neat learning document. I've learned to program reading PierrotLL (Gravity Duck guy)'s code.

I just want it to be clear and documented before releasing, and hoping someone can understand what's and how it's going on.
Title: Re: [Axe] Hinawa Battle Engine
Post by: DJ Omnimaga on May 10, 2014, 11:03:55 am
Thankfully in hybrid BASIC we have 1540 KB of executable code space compared to 40 KB in Axe *runs*

Anyway glad this is still coming along.
Title: Re: [Axe] Hinawa Battle Engine
Post by: Eiyeron on May 10, 2014, 11:52:27 am
SCREENSHOOOOOTS! FInally!
(http://geekbros.tk/~eiyeron/screenshots/HBE%20Capture%202.gif)
Title: Re: [Axe] Hinawa Battle Engine
Post by: Matrefeytontias on May 10, 2014, 02:37:39 pm
That's epic :D nice work on these !
Title: Re: [Axe] Hinawa Battle Engine
Post by: TheCoder1998 on May 10, 2014, 03:45:00 pm
that's looking pretty awesome :D
Title: Re: [Axe] Hinawa Battle Engine
Post by: Streetwalrus on May 10, 2014, 05:38:20 pm
Woa, nice, updates ! :D

Also, not about optimizations but there are also some ways of coding that help you code faster. For example, if you only use variables with names that don't mean anything, after a week of break the only thing you can do is start over because you don't understand anything to your code anymore :P
I abuse r1-r6 in Illusiat. <_< But just by looking at the source you can tell what does what since it's commented/labeled well enough and I use A-theta for global variables.
Title: Re: [Axe] Hinawa Battle Engine
Post by: Eiyeron on May 10, 2014, 06:07:35 pm
Yeha, me too, I'm ab(using) the registers, I just should sometimes look out which are used in a routine to avoid mees when call subroutines inside subroutines! :p

Aaanyway, I have to admit that a lot of place are quite well optimized. It can be maybe more optimized but the biggest byte eater is all the visuals, sprites and misc. Removing the background( routine and sprites) made me spare temporary ~500 bytes. In the end, I want all the data to be separated from the engine, and call the engine from a hypothetical game, to load it only when it's needed.
Title: Re: [Axe] Hinawa Battle Engine
Post by: Streetwalrus on May 10, 2014, 06:15:07 pm
Well r1-r6 are not registers, they're variables just like A-theta. :P Just that they are commonly used as routine arguments and local variables.
Title: Re: [Axe] Hinawa Battle Engine
Post by: pimathbrainiac on May 10, 2014, 09:11:52 pm
Thankfully in hybrid BASIC we have 1540 KB of executable code space compared to 40 KB in Axe *runs*

Anyway glad this is still coming along.

Well, you can run a compiled assembly program in an axe program if you know how, increasing the amount of executable code you can have. There's also crabcake :P
Title: Re: [Axe] Hinawa Battle Engine
Post by: Streetwalrus on May 11, 2014, 03:38:18 am
DJ included the use of Fullrene + PageSwap in the 40kB.
Title: Re: [Axe] Hinawa Battle Engine
Post by: Eiyeron on May 11, 2014, 09:02:17 am
So, at the moment I separated the turn definition (determine the turn's order, not working atm) and the damage application (not woorking too, its just a random damage to a random player.) I could manage a lot better the turn workflow (just a Z-Test atm) add an attack announcement and even a little animation (just a placeholder to see if the engine is not in a glitched state).

So there is a lot of progress since I started programming again here. I plan to release more screens, but there aren't a real graphical change.
Title: Re: [Axe] Hinawa Battle Engine
Post by: Eiyeron on May 13, 2014, 05:12:45 pm
Little update : I started managing character death. The engine detects when a character dies and a textbox blocks the game. For now it's more a flag based, but I'd like to use a stack to conserve death order. (but I'd lose at least one RAM byte.)

I should manage too turn skippimg the current character dies. I'll do it maybe after the turn is well defined (to manage too characte's death during an attack.)

Oh, and I should make string concatenation to a buffer routines. How did I forgot that?!


EDIT : bumpity bump to say I locked the poll. I'll release the source in the week-end. Beware of obscure code (specially in rolling meters updating). Someone for helping me with string concat?
Title: Re: [Axe] Hinawa Battle Engine
Post by: Eiyeron on May 16, 2014, 05:50:11 pm
Major update : go check the source at the Original Post. And by the way read the ReadMe.
Title: Re: [Axe] Hinawa Battle Engine
Post by: DJ Omnimaga on May 28, 2014, 03:51:26 pm
I am a bit late, but I was astonished at that screenshot with the moving grayscale background like in Earthbound O.O
Title: Re: [Axe] Hinawa Battle Engine
Post by: Eiyeron on May 28, 2014, 03:57:36 pm
Don't be sorry for being late, my updates are always running more or less without big noise, so. But thanks for the praise. Keeping the non modal system is the hardest part of the engine.
Title: Re: [Axe] Hinawa Battle Engine
Post by: Eiyeron on May 31, 2014, 12:12:01 pm
Little news : I successfully refactored the text box routines to avoid some problems :
- I merged the previous two line buffers into one buffer. That improve character management as we don't need null terminal character anymore
- Thus the character and word wrap are greatly improved as they are now simpler.
- I successfully squished more than 100 bytes for further improvements (more will be squished as I haven't do it at the moment.)
- Speed should be roughly the same, faster or slower, I don't know.

I'm still struggling at how will I implement special behavior for special character, like "insert character 1's name here".
Title: Re: [Axe] Hinawa Battle Engine
Post by: Eiyeron on June 07, 2014, 04:49:55 am
Good news everyone! I had like two dead hours and spent them into doing what I planned. Now alternate buffers can be accessed to add non constant data to the text box.

"What that means?"

Let's take the only option I implemented yet : Add these character in a string (not surrounded by ") [01010X].

[01]=>Control character
[01]=>Display character's name
[0X]=>Uses xth character's name (where X is between 0-3)

Aaaand it works! For instance I use it in the death announcement. That's better to read " LUCAS collapsed." than "1 DEATH", right? Now I need to check if things like word wrap aren't broken with this addition.

Fun bug : "..." (Three dots, not the character …) is not working. I force a line break. I have to inspect that.
Title: Re: [Axe] Hinawa Battle Engine
Post by: Streetwalrus on June 07, 2014, 04:57:09 am
Sounds very cool ! :D
Title: Re: [Axe] Hinawa Battle Engine
Post by: Eiyeron on June 07, 2014, 11:21:05 am
Just fixed the bug. It wasn't related to the dots but to the pointer save when switching to alternate buffer. I wrongly offseted the pointer and thus the word length calculation was biased and returned around midline. Now it's fully functional.
Title: Re: [Axe] Hinawa Battle Engine
Post by: Streetwalrus on June 07, 2014, 02:53:43 pm
Massive pic ! \o/
Looks nice tho. ;)
Title: Re: [Axe] Hinawa Battle Engine
Post by: Eiyeron on June 07, 2014, 02:57:02 pm
Looks like my phone took its first nice shot. :p Do you want I resize the photo?
Title: Re: [Axe] Hinawa Battle Engine
Post by: Streetwalrus on June 07, 2014, 03:07:26 pm
Lol, it's hard to take good pics with the N4, but when you do, they're epic.
Title: Re: [Axe] Hinawa Battle Engine
Post by: TIfanx1999 on June 10, 2014, 09:51:44 am
Looking good! ;D
Title: Re: [Axe] Hinawa Battle Engine
Post by: DJ Omnimaga on June 10, 2014, 04:08:32 pm
Looks nice. Regarding the checkerboard in the pic, is it due to the camera or did you decide to not use Graylib?
Title: Re: [Axe] Hinawa Battle Engine
Post by: Eiyeron on June 11, 2014, 01:51:01 am
Using graylib makes the game more slower than ever, it doesn't let me enough cycles to run a full screen update in time. I'd like to, but as I redraw the whole screen each frame, that's just imposibubble.
Title: [C / Axe?] Hinawa Battle Engine
Post by: Eiyeron on November 26, 2014, 04:49:35 pm
Hello everyone. I won't introduce again this project I have. Yes? You still want? Okay.
My projects are most of the time remakes or reproducing mechanisms of games I loved. I started programming (on calcs and on Casio) by trying to port Pokémon Gen I battle engine To Casio AFX2.0/Graph100+. I got through some projects in the same branch, but another one (almost finished) stood up : Bust-a-Move. All of them are past. Now, I'd like to program something. A project way more complicated but that could open (at least to me) to new games. I'd like to reproduce for starters the battle engine of Mother 3 and Earthbound.

This battle engine is a semi turn based classic RPG battle engine. You ahve your party, the enemy's. each one decide its actions for the turn and the turn is going on its way. THat could be just a simple project, but here's the tweak in three(four if you count & as one) words : Modularity & Open Source.

Modularity

Modularity means that the engine should be an independant part of bigger projects. Only some functions will be needed to set up the engine and run it. I'm still planning a lot of the structure and having many design difficulties (shmibs will talk of exeprience after reading the first version's C code...) but I want it to be most clear possible to be hackable by everyone who has some good C/Axe programming skills.

Modularity means too OCP (Open/Closes Principe). I' like it to support a event system and scripted IA which could add a deeper experience to the battles. I'd like at least to be able to reproduce all the quirky events of said games (like self-exploding trees at their death, the textbox in [REDACTED]'s battle, etc...) but that's not really a critical feature.

In the end, modularity means grouping the code in modules to be able to swap them. The most important instances of this meaning here are graphism and I/O (and audio? I dreamt of a thing months ago, but that's still a dream T_T). Graphism and I/O code should be engine independant. I'd like to run the engine on computer as well as calculators. For that, lots of think are being spent on how to  split the graphic data from the engine's. that's not an easy task, i.e. Casio FX-9860 are using 2-bits sprites where Black are 1 and 0 White. If someone were to use directly these functions in, lets' say SDL, that won't certainly work unless big ugly hacks are done. So graphism should too be a independant part to be free of using whatever is needed by the target. Same for file I/O or input management. That also brings a problem : where to put the UI? Graphism module? Input Module? Battle Engine?

Open Source.

Before talking about open source, there should at least be source code. The project started on calc with Axe Parser as I only had that at my hand. The code became quickly as unreadable as ancient dwarf arcanes. Forget about reading it, it has little sens to begin with. I ported the knowledge I had on HBE to C and tried to make a clean basis with Casio Fx-9860 in mind. Second failure, I got cold scoled by Shmibs and I realized that if there were more sense to my eyes, it wouldn't be the same for the others.

So now, I'm clampled to wonder and ponder. Ponder the open source from beginning, wonder how the source code should be structured. Ponder the feasability of the project, wonder if I should ask for help as I already tried in vain. I don't want it to be just lost time into a unborn project. I'd like to have better feedback from anyone with enough experience to tell me how parts of the project could be done without being taken as an inexperimented programmer. I'd like to see who are interested into this heavy project and how much they are. I'd like in the end to see one of my game project plan to be achieved with this engine and maybe other people using it.

So at this moment, I store a repository in a private GitLab (http://gitlab.com) repo. If anyone wants to mess with the few headers I have at the moment, feel free to poke me and I'll make the repo public or allow you to mess around.


So yeah, so much for a simple calculator project. Something that everyone could do, but I want to do it in a way that lot of peoples would be able to help or improve. That's the real meaning behind this project. (That and the fact I'm more and more thinking about a real calc -or not- game behind that.) Thanks for reading it.
Title: Re: [C /axe?] Hinawa Battle Engine
Post by: Eiyeron on December 05, 2014, 04:51:31 am
Not really HBE's code relatedn but I started implmenting MAkefile-wise mutli-target system. With a variable change (here TARGET), you can choose to compile for "DESKTOP" (use your computer's gcc) or "FX_9860" (use sh3-eb-gcc). Obviously, compilations flags will depend of your target.

Now, platform dependant code is locate in {include, src}/$(TARGET) . That'll help making the engine platform independant. Does anyone has a way to make that a little bit cleaner? (like moving the source into an arch folder or something else)?

Addendum : How could I program Axe on computer? It would be fun to have an Axe target! :p (But quite unmaintenable or unusable as the engine will surely take too much  ram for a simple C compilation)

EDIT : I started to draft an UML schema to help me vizualize the struture. Here's the thing at this moment. Do you have an idea about what's going on with it? Does it seem clear to you right now?
Title: Re: [C /axe?] Hinawa Battle Engine
Post by: Streetwalrus on December 05, 2014, 10:23:57 am
Well you have SDCC which can output z80 code. You need to implement the OS calls though.
Title: Re: [C /axe?] Hinawa Battle Engine
Post by: Eiyeron on December 05, 2014, 11:54:00 am
Does it make a good work optimizing? It's pretty critical to have size optimizations when one have 20KB of RAM.
Title: Re: [C /axe?] Hinawa Battle Engine
Post by: chickendude on December 05, 2014, 12:25:32 pm
Contra and deeph also did some work with C over at yAronet:
CTI83Compiler un programme en C pour ti83 (http://www.yaronet.com/posts.php?sl=493&s=138500)
[C] TI-Lib (http://www.yaronet.com/posts.php?sl=493&s=158510) - a C library for writing games, essentially making GBA Lib usable in C programs. deeph says it's based off GBA lib 2, but ticalc only lists GBA lib v1.0.
Title: Re: [C /axe?] Hinawa Battle Engine
Post by: deeph on December 05, 2014, 12:35:07 pm
deeph says it's based off GBA lib 2, but ticalc only lists GBA lib v1.0.
Yes the author, Martin Bousquet, only sent it to me for debug purpose, but since it never came out I decided to publish it so everyone could enjoy it.

And concerning TI-Lib I haven't continued it (yet) as it seems to have no interest for anyone but me.
Title: Re: [C /axe?] Hinawa Battle Engine
Post by: Eiyeron on December 05, 2014, 01:15:04 pm
Thanks for the link but I meant "how will be able to fit a medium/heavy battle engine, with sprites (forget attack animations or just basic ones), hypothetic battle background and enemies sprites in a  nutshell! :p

At the moment I'm working at the core engine. Graphisms, input, I/O will be for later. I need to figure the rest of the thing and it'll take some time as I'm not a program designer.
Title: Re: [C /axe?] Hinawa Battle Engine
Post by: deeph on December 05, 2014, 03:01:33 pm
you'll certainly need to use some sort of compression, I think (see http://webcache.googleusercontent.com/search?q=cache:jh5334_f5mwJ:quasar.cpcscene.net/doku.php%3Fid%3Ddossier:compression+&cd=1&hl=fr&ct=clnk&gl=fr for examples).
Title: Re: [C /axe?] Hinawa Battle Engine
Post by: Eiyeron on December 05, 2014, 04:29:08 pm
Oh thanks, I've never seen the third one. Thanks for the link! (I already had a sort of RLE on the Axe prototype)

EDIT : I made progress in the UML schema but I'm having troubles with arrays/ multiples function arguments. ><"
Title: Re: [C /axe?] Hinawa Battle Engine
Post by: Eiyeron on December 09, 2014, 11:02:45 am
Sooo, I've been some tweaks to port Monochromelib (FX-9860 graphical librairy). It works on SDL2 and mostly works. This help testing here and there things on computer easier than on calc (avoiding Casio's SDK, ddd to debug, etc...) Buuut:

What I need to finish

- Converting variable size sprites blitting functions (ML_bmp_(or|xor|and), not ML_(8|16)_x ). As endianess is totally different from computers, I'll maybe try implementing it the worst way possible (pixel per pixel), unless someone has some functions like that.
- Scrolling is borken for same problem : endianness.
- Finding a way to rescale the SDL_surface when I rescale the window and scale/center the output.
- Free SDL things.
- Checking with some tests.

You can use it as you would use ML but you have to do two things:
- Check ML_SCALE and change it to change the screen scale
- Use ML_Init() in main() to initiate the screen.
Title: Re: [C /axe?] Hinawa Battle Engine
Post by: Eiyeron on December 12, 2014, 05:24:04 pm
I took the time to make a page, finally. I'll sum all the info/screenshots/download there : http://geekbros.tk/retro-actif/portfolio/hinawa-battle-engine/