[community project] RPG

Advice on general approaches or feasibility and discussions about game design

Re: [community project] RPG

Postby Sorunome » Sun Apr 03, 2016 10:44 pm

superfreaky wrote:Is that the song from 101 starships?

Yes, I used it to test the sound engine, that's all. It'd be super awesome if somebody would be willing to compose songs for this! :D
User avatar
Sorunome
 
Posts: 629
Joined: Sun Mar 01, 2015 1:58 pm

Re: [community project] RPG

Postby superfreaky » Mon Apr 04, 2016 4:12 am

Are you ok with photocopied handwritten sheet music? Cuz that's easiest for me. I also draw sprites with graphing paper :D
superfreaky
 
Posts: 183
Joined: Wed Oct 28, 2015 1:46 am

Re: [community project] RPG

Postby Sorunome » Mon Apr 04, 2016 8:53 am

Something like that is better than nothing, the background music can have up to two tracks.
As for the sprites, if you make an acc here: https://sorunome.de I can give you access to the dev tool which would allow you to create sprites directly for it.
If you don't like that option i guess you might as well graph on paper and i'll plug it into there.

EDIT: So, just for fun I started customizing the gamebuino library to optimize for ram in our usecase. So far I managed to scrap out 27 bytes of ram by 100% removing code for the battery indicator and by simplifying how buttons work a lot. I haven't tackled sound or the display yet.

But, do you guys think it's worth it to modify the gamebuino library to scrap some ram? According to my calculations, the gamebuino library plus the SPI library (without the 512 bytes screen buffer) use 478 / 451 bytes, out of which sound uses currently 96 bytes.

EDIT2: So I added some more information stuff to the first post, especially good for people seeing this thread for the first time and not wanting to read the whole of it.
User avatar
Sorunome
 
Posts: 629
Joined: Sun Mar 01, 2015 1:58 pm

Re: [community project] RPG

Postby superfreaky » Mon Apr 04, 2016 4:25 pm

I may try actually figuring out how the development tools work for music and sprites. :D
Creating enemies, I think not to many. What I want for this game is not to be primarily focused on fighting to carry the game, but more just quests and puzzles with some fighting. The game should start the player in the middle of the map(s) with paths leading in all directions, with lots of people asking for things. I think once you complete enough quests, you get a key to the other half of the game/story, but have the option of staying and finishing every side quest, as I think that would automatically give the game more replay value for most people. And a few secrets would be cool too!
My first enemy class (no sprite yet) is Guards. Logically enough, Guards stand in front of certain gates, and attack if you get too close, chasing you off screen. I haven't started making a sprite yet, any artists would be nice for this. Anyone?
PS: good call editing the first post.
PPS: I think I'm gonna come up with a 2 syllable name instead of " Odnipar" because it just sounds too weird, and wizards seen to have 2 syllable names in general.
PPPS: more RAM is better, I am not too bothered by no battery indicator or stuff like that. The battery is practically infinite anyway!
superfreaky
 
Posts: 183
Joined: Wed Oct 28, 2015 1:46 am

Re: [community project] RPG

Postby Sorunome » Mon Apr 04, 2016 10:01 pm

superfreaky wrote:I may try actually figuring out how the development tools work for music and sprites. :D
Unfortunatly I didn't write anything for music, only for sprites :/
superfreaky wrote:Creating enemies, I think not to many. What I want for this game is not to be primarily focused on fighting to carry the game, but more just quests and puzzles with some fighting. The game should start the player in the middle of the map(s) with paths leading in all directions, with lots of people asking for things. I think once you complete enough quests, you get a key to the other half of the game/story, but have the option of staying and finishing every side quest, as I think that would automatically give the game more replay value for most people. And a few secrets would be cool too!
Yup, l like it that way. Just, like, not too few fighting, either, like, it should also be not too easy on the fighting part, but complex puzzles are awesome
superfreaky wrote:My first enemy class (no sprite yet) is Guards. Logically enough, Guards stand in front of certain gates, and attack if you get too close, chasing you off screen. I haven't started making a sprite yet, any artists would be nice for this. Anyone?
Yeah, we kinda need artists >.<
superfreaky wrote:PS: good call editing the first post.

Thanks!
superfreaky wrote:PPS: I think I'm gonna come up with a 2 syllable name instead of " Odnipar" because it just sounds too weird, and wizards seen to have 2 syllable names in general.
That's fine to me!
superfreaky wrote:PPPS: more RAM is better, I am not too bothered by no battery indicator or stuff like that. The battery is practically infinite anyway!

Ok, so custom gamebuino library it is, then. You can find it here: https://github.com/Sorunome/Gamebuino/tree/rpg_test

I also started adding a basic scripting system to it. Before saying that it'd be overkill, let me line out why it isn't overkill and what it could be used for :)

This scripting system can already be used for running scripts when walking onto a tile, this would easily allow such things as walking into a house, walking onto a switch, walking into a trap and things like that.
It would also allow for easily scripted cutszenes and thelike.
The scripts themselves are streamed off of the sd card, so don't expect too much performance on them, though it is more than sufficient for its purpose.
This is an example of a simple script:
Code: Select all
fade_to_white
set_map(2)
update_screen
fade_from_white
return_true

It should be quite clear what it does, i could easily add "set_map_with_fade 2" or something which will expand into that (but I won't just now as I'll be adding more arguments for player position and stuff...). The 2 is the map id displayed in the dev tool, i plan on adding named aliases because that's more human-readable.

These are the commands I currently implemented:
  • fade_to_white - Fades the screen to white
  • fade_from_white - Fades the screen from white to whatever contrast your screen was in previously
  • set_map <num> - Sets the current tilemap and loads it
  • set_player_x <num> - Sets the x-position of the player, in pixels
  • set_player_y <num> - Sets the y-position of the player, in pixels
  • focus_cam - Focuses the camera onto the player
  • update_screen - Updates the content of the screen
  • return_false - Returns false
  • return_true - Returns true

Oh, this scripting system will probably also save quite some space once we have longer cutscenes and thelike.
Last edited by Sorunome on Tue Apr 05, 2016 11:12 am, edited 1 time in total.
User avatar
Sorunome
 
Posts: 629
Joined: Sun Mar 01, 2015 1:58 pm

Re: [community project] RPG

Postby superfreaky » Tue Apr 05, 2016 3:33 am

The song I pulled a little bit of inspiration from is here (https://www.youtube.com/watch?v=kC4FYlN-uJY)
It's not really theme song material though. I'm listening to a few songs from classic games for inspiration.
superfreaky
 
Posts: 183
Joined: Wed Oct 28, 2015 1:46 am

Re: [community project] RPG

Postby Sorunome » Tue Apr 05, 2016 11:20 am

So I had a better idea on how to write the tokenizer (this is only the creating-the-script process that changed, the arduino part stayed the same (except for offsetting the commands)) and now the above script became this:
Code: Select all
fade_to_white
set_player_pos(tilemap_1,2*8,2*8,focus,update)
fade_from_white
return(true)

fade_to_white and fade_from_white could also have () at the end, that is optional.
Functions cannot be nested, as you might notice with focus and update, the whole concept of variable types is different.
On the arguments all the defines in defines.h are applied (useful for getting the asm id of a tilemap etc.). After that simple calculations are applied (so that stuff like tilemap_1 * 2 is actually working). Simple calculations being things that only contain digits, + - * / ( ) and whitespace.

The whole parser is working case-insensitive.
The functions defined are the same as before, only that you need () around your arguments now. There are the following new ones (they just expand into existing stuff):
  • set_player_pos() - takes between 2 and 5 arguments. If only two are applied it's simply x/y of the player. If there are three it is tilemap/x/y. For more (technically also for three) if the very last one is update it'll also update the screen, if the very last or second to last is focus it'll also focus the camera onto the player.
  • return(true) / return(false) - just an alternative syntax.

Beware, the parser assumes valid syntax. If you have invalid syntax you might blow up your house.

EDIT: videos explain way better than words

EDIT2: I improved the speed greatly now so that it is way quicker than in that video.

The code for the script in the video is:
Code: Select all
define_vars(x,y,limit)
set_var(x,16)
set_var(y,16)
set_var(limit,32)
fade_to_white
set_player_pos(tilemap_1,x,y,focus,update)
fade_from_white
do
   inc(x)
   set_player_pos(x,y,focus,update)
while(lt(x,limit))

return(true)

I don't even know why i made y a variable but w/e
User avatar
Sorunome
 
Posts: 629
Joined: Sun Mar 01, 2015 1:58 pm

Re: [community project] RPG

Postby Sorunome » Wed Apr 06, 2016 9:29 pm

A few dark magic optimizations, some melted brains and some flipped tables later I went through optimizing sound! This strapped 65 bytes of ram away!
However, due to this, I disabled the volume-sliding command and some other stuff, i can easily add them back (did precompiler stuff for that), but that are 7 bytes of ram per channel, so for our case 14 bytes.

Anyways, if it was only for the ram i wouldn't have done it, I noticed something else: With the default sound library the sound froze when running the script. After some investigation I found out that gb.update(); actually performs essential parts for the sound system, so I moved those also to the interrupt.

I also did some other little optimizations as we always know where the sound data will be due to the dynamic flashing.

As you can probably guess, the modified library is a must now: https://github.com/Sorunome/Gamebuino/tree/rpg_test

the repo for the RPG thing is also updated accordingly.

P.S. I tried to implement triangle waves but those took next to 100% cpu :/

EDIT: So I tried again how many of those randomly moving black squares i could spawn.....seems like I run into RAM issues before I run into CPU issues, it handled 75 of those just fine without any lag at all!
User avatar
Sorunome
 
Posts: 629
Joined: Sun Mar 01, 2015 1:58 pm

Re: [community project] RPG

Postby superfreaky » Thu Apr 07, 2016 4:07 am

I assume you're wanting an ambient music theme? Or adventurous?
superfreaky
 
Posts: 183
Joined: Wed Oct 28, 2015 1:46 am

Re: [community project] RPG

Postby Sorunome » Thu Apr 07, 2016 9:12 am

superfreaky wrote:I assume you're wanting an ambient music theme? Or adventurous?

whatever you think fits well :)
There can be multiple songs depending on the mood, like dungeons could have a different tone etc.

EDIT: So, I just made the sound-data creation script work with multiple sounds, it'll also warn you if your sound is exceeding 1024 bytes. the 'name' attribute is optional, though i recommend setting it as it'll make things easier if they have a human-readable name instead of only a machine-created ID.
You can create the patterns with the Tracker, there must be exactly two tracks with the length of 20 each.

Or, well, you could just graph your two-track thingy on graph paper and take a pic and I do that work :P

Keep in mind when creating sound that you have square waves AND random noise to use, it can create neat stuff when mixing those ^.^
You can also play around with the volume in the tracks :)
User avatar
Sorunome
 
Posts: 629
Joined: Sun Mar 01, 2015 1:58 pm

PreviousNext

Return to Project Guidance & Game development

Who is online

Users browsing this forum: No registered users and 7 guests

cron