Tuesday, July 16, 2019

scripting - How to define data for an input sequence game?


I'm starting to program my very first game, it's a clone of DDR/Stepmania done for research purposes and learning.


I (at this early stage) get most of the UI/Music/input work that should be done, but what i still can't grasp is scripting, i've read about Lua and that you shouldn't use it with XNA/Monogame as C# is capable enough, but i cannot get the utility of it.


Assuming the needs of my game, What would be the ideal way to implement the input sequences it needs?, i thought of XML/Json, let's say Stage 1










Is that a correct implementation? or are there better ways with more benefits?



Answer



There's no reason to use a script if you're just storing time-based data.


There's many different ways you can design a file format for your data. As long as you can load it into the game, whether you used XML, binary, plain-text, etc, is not very relevant.


As long as your format allows you to add new information without breaking the previous format (during development this doesn't really matter) or rewriting your parsing,



What I'd do is store each song in a folder, containing an mp3, background image and/or video (if applicable), and my level files. Having a new level file for each difficulty, and having each one have it's own reference to the mp3 and other assets, allows users to easily share any difficulties that they've created by sending each other just the level file.


As for the levels themselves, you'll want to store data such as the offset for the song (the amount of silence before the song starts. It's rare to find a song that doesn't have this) and other metadata. You'd probably also want to store the speed of the arrows, and allow the BPM to be changed at any point in time during the song.


Also, it's more crucial to have a good, functional level editor in rhythm games than it is in most other types.


No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...