Page 2 of 2

Re: How do you organize your project(s) ?

Posted: Tue Jun 07, 2016 4:58 pm
by Sulunia
Linkpy wrote:Oh, quiet good you two !

Sulunia, for me I really don't like having .lua file in my main folder (except conf.lua and main.lua, of course). And I tried Beatfever and it's looks very good, but... What I see in you image, you have not so many files for what you done. I don't understand how you do :crazy:
This is because i tend to break a file into multiples whenever they start getting too big. From beatfever itself:

Code: Select all

-FileParser.lua //Interprets osu files and separates all information
|	--ObjectParsing.lua //Parses hitObjects in an osu beatmap
|	--GameObjects.lua // Holds object information 
Which means the Parser calls functions from ObjectParsing and GameObjects to do it's work. Most game screens are actually just structured calls to functions in subfiles. Which, again, is messy as hell.
Actually, if someone has a good idea on how to organize this i'll be pretty glad. :D

By the way, i have been reading your blog about osu!max. If you need help with parsing information or even the project itself, feel free to ask about. The osu file format is a bit tricky.

Re: How do you organize your project(s) ?

Posted: Tue Jun 07, 2016 6:14 pm
by Linkpy
Oh, for me a big file is like 300-400 lines o.o

Currently no, I won't use osu!'s beatmap file format, I'll use my own for better customization. The game will be fairly easy on the side of the gameplay, so I'll make it with many graphical FX. And this project is the first game I'll publish under my society name : "NeoShadow", so I want to do it by myself, but thanks for the proposition :)

Re: How do you organize your project(s) ?

Posted: Tue Jun 07, 2016 9:05 pm
by marco.lizza
It's somewhat odd that so may developers devised a similar project structure. I've also seen very badly unstructured projects that works perfectly, but an organized one put the mind at ease when working on it.

Personally I'm adopting something like the following structure

Code: Select all

+- root
+- assets
   +- data
      <generic assets such as maps, texts, etc...>
   +- fonts
      <TTFs and pixelfonts>
   +- images
      <static images>
   +- shaders
      <pixel shaders>
   +- sheets
      <animation sheets>
   +- sounds
      <sound files>
+- game
   +- entities
      <game entities scripts>
   +-- states
      <game-state scripts>
   <game scripts>
+- lib
   <support scripts>
+- conf.lua
+- main.lua
I'm not using OOP in the strict sense, but a mix-in base variant (for example to handle entities). However, almost every script file exposes it's functionalities in a "class-oriented" way (in order not to have global variables flying around).

Also, modules are very compact and they rarely exceed 300 lines (header and comments included).

Lastly, I'm not relying upon 3rd party external libraries. I create my own tailored version of the support libraries I need, since I don't want to overengineer and adopt I library only to use it at (let's say) 2% of its scope.