Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

 
Advanced search

1370232 Posts in 64449 Topics- by 56500 Members - Latest Member: zulaisaias

December 09, 2019, 06:28:28 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsPlayerGeneralWhat methods do you use to make a game in 24 hours?
Pages: 1 [2] 3
Print
Author Topic: What methods do you use to make a game in 24 hours?  (Read 909 times)
fluffrabbit
Guest
« Reply #20 on: October 01, 2019, 04:52:44 AM »

For you to spend AN HOUR trying to compile my little compo game shows dedication. Yeah, I spent a lot of time on low-level stuff. I enjoy the engine stuff a lot more than actually making games. But fuck me, I'm not an "engineer". Even if I get that compsci degree, it's a mindset thing. Nevermind all the time I put into graphics programming and whatnot.

Ehhhhhhh
Logged
michaelplzno
Level 4
****



View Profile WWW
« Reply #21 on: October 01, 2019, 04:55:37 AM »

I was mostly curious about open source projects because I just started one so I wanted to know more about how it goes from the user end of things. If you want I can upload visual studio files or an EXE build for you in case you care.

If you use the makefile does it compile the data folder into the .exe so its all just one file? I want to learn how to do that because I find that when you release a .zip folder people sometimes get confused as to how to unzip everything and a single .exe would be better.
Logged

fluffrabbit
Guest
« Reply #22 on: October 01, 2019, 04:58:25 AM »

I would very much appreciate a VS project. I've already got a Windows EXE. Send a PR and you'll learn the GitHub. Or I can upload the files myself, however you want to do it.

The makefile only compiles the source code and libsdlmain.a into the file. The data folder is strictly separate.

Anybody who gets confused by a zip is subhuman and needs to die.
Logged
michaelplzno
Level 4
****



View Profile WWW
« Reply #23 on: October 01, 2019, 05:03:52 AM »

Let me see if I can figure out a pull request. I'll try to organize it correctly, the problem is to compile in visual studio the code needs a few tweaks. (Hence why it took so long, first trying to get it to run with the makefile which had several hurdles, then having to fix errors in VS)

I just want to organize it so that I don't include SDL files but that its clear where to get them. You need a set of .lib files to compile it, I assume I can't just put them into your repo?

Edit: Also re: zip files -> Why must you be such an angry young man?



« Last Edit: October 01, 2019, 05:29:30 AM by michaelplzno » Logged

fluffrabbit
Guest
« Reply #24 on: October 01, 2019, 05:07:24 AM »

You changed the code? I am curious about it.

No binaries in the repo please.

The makefile deletes include/SDL2 in its "clean" action. Are you familiar with wget?

What do you mean by "re-zip"?
Logged
Superb Joe
Level 10
*****



View Profile
« Reply #25 on: October 01, 2019, 05:08:30 AM »

thank you for the kind words everyone, i have enrolled in several martial arts classes to comprehensively defeat picasso in hand to hand combat when the time arises.
Logged
fluffrabbit
Guest
« Reply #26 on: October 01, 2019, 05:11:22 AM »

thank you for the kind words everyone, i have enrolled in several martial arts classes to comprehensively defeat picasso in hand to hand combat when the time arises.

Make sure judo is on the list.

AFK guys

Before I go I thought I should point out that Akira Kurosawa's first film deals with judo and his last film deals with Picasso.
Logged
Superb Joe
Level 10
*****



View Profile
« Reply #27 on: October 01, 2019, 05:16:01 AM »

i shall be enlisting the help of akira kurosawa, a man who knows my enemy and the pathway to victory in this battle
Logged
michaelplzno
Level 4
****



View Profile WWW
« Reply #28 on: October 01, 2019, 05:19:52 AM »

So for the dynamic sized array you just made a variable set to 5 and then created the array with that variable + 1. So I just dropped in the magic number 6 in there and fixed that with the VC compiler. Also Visual Studio pushes a safe version of a lot of c file IO so I use stuff like sprintf_s https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/sprintf-s-sprintf-s-l-swprintf-s-swprintf-s-l?view=vs-2019 These are to prevent buffer overruns and in your case I think they make no difference, but I either had to change the code or disable the error in visual studio and it was easier to change the code.

I had to download a program to use wget on my windows machine, I had never heard of it. I'm not really a fan of downloading the libraries for each compilation just due to the time it adds to everything. For visual studio there are SDL .lib files that need to be in a directory for the linker phase of compiling, I can just mark a directory for where you should put them if you want to compile with VS. Then you just leave them there in my experience.

re-zip means I am replying about your remark about zip files.

Of course, Yojimbo is my favorite.

Logged

Daid
Level 3
***



View Profile
« Reply #29 on: October 01, 2019, 05:29:12 AM »

You changed the code? I am curious about it.
The variable length array stuff doesn't compile on msvc.

I stopped trying to support msvc in my projects. Just too much "nah, we do not follow the standard". And mingw-w64 works just fine.

My new "compile for windows" instructions are:
Code:
sudo apt install build-essential mingw-w64 git cmake
git clone https://github.com/daid/EmptyEpsilon.git
git clone https://github.com/daid/SeriousProton.git
cd EmptyEpsilon
mkdir _build_win32
cd _build_win32
cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/mingw.toolchain -DSERIOUS_PROTON_DIR=../../SeriousProton
make -j 8 package
And grab the created zip file to enjoy the game, resulting zip runs on windows without WLS enabled.


While you can also run without the Linux Subsystem and just direct cmake on windows. It's much easier then manually installing a bunch of libraries, setting up paths for windows compilers and cmake.
Large part of the trick is in the mingw toolchain file, which checks if the required libraries are there, and else downloads and builds them. As getting the proper SFML for your setup was a pain in the ass otherwise.


Amount of contributions to the code have gone up after I made this. So I call it a success :-)
Logged

Software engineer by trade. Game development by hobby.
The Tribute Of Legends Devlog Co-op zelda.
EmptyEpsilon Free Co-op multiplayer spaceship simulator
michaelplzno
Level 4
****



View Profile WWW
« Reply #30 on: October 01, 2019, 05:36:11 AM »

@Daid This seems like the best option. I would have had a much easier time with that.
Logged

fluffrabbit
Guest
« Reply #31 on: October 01, 2019, 06:43:24 AM »

I guess I'll eventually have to learn toolchain files.

Isn't sprintf_s a C11 feature? If so, Microsoft can fuck off. And don't put .lib files anywhere. The makefile doesn't download and sadjfpsadjgopfsdfopago[sdjg


If you use Windows, because it is not POSIX, just download the stuff. IDK if ReactOS has an Ubuntu mode, but it's FLOSS while Win10 is not. You gotta do things the right way when you put together an open source project. The fact that someone could be an experienced programmer yet new to open source blows my mind.
Logged
michaelplzno
Level 4
****



View Profile WWW
« Reply #32 on: October 01, 2019, 02:57:30 PM »

Mostly I don't know the best practices for low level stuff like makefiles, compiling and which files to include.

I want to link my open source Blokaroka against a physics engine thar is also open source, box2d but just how to organize it is boggling my mind. I like download and go: include every file in the build, but it seems a lot of open source people disagree.
Logged

fluffrabbit
Guest
« Reply #33 on: October 01, 2019, 04:11:33 PM »

The key is to assume that nobody trusts or understands you. Your code is your code, and third party code is third party code. Keep them as separate as possible. GNU/Linux distros make this easy with package managers, which install specific dependencies system-wide as if they were DirectX or something. Mac has Homebrew.

On non-POSIX systems (Windows being the main one) you gotta figure out a hack to emulate this behavior. With SDL it's a simple matter of telling people how to download and place the libraries in the project. This can include copying over the headers. With a more complex collection of dependencies, scripting and makefiles help to alleviate the problem.
Logged
michaelplzno
Level 4
****



View Profile WWW
« Reply #34 on: October 01, 2019, 05:00:51 PM »

That's helpful thanks. I would have assumed you just load up every file you need in the repo but that is clearly wrong.

Edit: Also VS project files are a bit of a problem, I'm not sure if you can add dependencies to them that are based on file location relative to the project. They like to have all the files already there, so adding header files from SDL to the project would be an issue. I guess I would want a script for windows that downloads all the additional code and then generates the VS project file, that would be the best result.
Logged

Daid
Level 3
***



View Profile
« Reply #35 on: October 01, 2019, 10:38:52 PM »

I guess I'll eventually have to learn toolchain files.
Note that this is abuse of toolchain files, normally those are just to specify a specific compiler and cross compile setup.
You could also do this straight in the CMake file. But I put it in toolchain files so I have it separated per target. For example, the android toolchain file sets up the android SDK if it cannot find it.



Mostly I don't know the best practices for low level stuff like makefiles, compiling and which files to include.

I want to link my open source Blokaroka against a physics engine thar is also open source, box2d but just how to organize it is boggling my mind. I like download and go: include every file in the build, but it seems a lot of open source people disagree.
The "standard" method is having your makefile just link to the libraries and assume they are there. More advanced systems like autotools (avoid it like the plague) and cmake can find libraries for you. And, offer enough other functions that you could actually download the libraries.


However, I choose to have this folder in my repository:
https://github.com/daid/SeriousProton2/tree/master/extlibs
Sources for the main libraries I use, except for SDL2. As most of those do not provide binary packages for windows, it's a hell to setup your dev environment otherwise.

Linux purists are against this. But who cares, it works, it's reliable, as you know what version you have, and it's easy to setup an development environment. No problems with "oh, you need version 2.4 and your package manger only supplies 2.3", or "your package manager installed version 3.5 which changed an API call and now your code no longer works" and the worst "the package manager does not have this package"

You won't make it into the debian package repository like this. But is that your goal? Most likely not. Seeing the question of this topic, "use what is easy, quick, and reliable".


I guess I would want a script for windows that downloads all the additional code and then generates the VS project file, that would be the best result.
CMake can do just that, it has a generator for visual studio projects.




Back on the main subject of this topic. "What methods help in making a game quickly". I have a few things in my engine that help. For example, in debug mode, sprite animation definition files get automatically reloaded if they are changed. So I don't need to quit&restart to see changes in things like animation frame order animation speed and other things. Just edit the file and save while the game is running.
https://github.com/daid/SeriousProton2/blob/master/src/graphics/spriteAnimation.cpp#L62

Same goes for my GUI definition files, which you can setup with auto reloading:
https://github.com/daid/SeriousProton2/blob/master/src/graphics/gui/loader.cpp#L31
(however, that contains some pretty hefty limitations at the moment)


Both allow for quick iterations. Which speeds things up. For example, yesterday I judged the size of a spritesheet wrong, it had 32x32 sprites instead of 16x16. So when I finally found the enemy that used that sprite it was messed up. Opening the data files, changing the size, save, and 30 seconds later I could see it was looking proper now. But the animation speed needed some adjustment, another quick change. And it was right now.


Both could also be done with WYSIWYG editors, but editors are complex to make and maintain. And the text files offer a lot of flexibility that would be hard to capture in a visual editor.


Scripting certain behavior like enemies also falls in this category. I have scripts setup for enemies now (just did this yesterday) and those scripts get loaded every time an enemy is created. So once again, I can change things without restarting the game.
Logged

Software engineer by trade. Game development by hobby.
The Tribute Of Legends Devlog Co-op zelda.
EmptyEpsilon Free Co-op multiplayer spaceship simulator
fluffrabbit
Guest
« Reply #36 on: October 02, 2019, 02:04:40 AM »

Personally, I'm put off a bit by a script that downloads a bunch of things from the net. My makefile is short and readable and only downloads one file, a Windows SDL2 development package. Projects with a lot of packages often list what they are and say "you need these". GCC users know what to do.
Logged
Daid
Level 3
***



View Profile
« Reply #37 on: October 02, 2019, 06:24:48 AM »

Personally, I'm put off a bit by a script that downloads a bunch of things from the net.
I fully understand that. Which is why my toolchain files are optional. If they are not used, then the normal cmake methods of finding libraries are used (another reason why downloading is only done in the toolchain files)


I once spend a whole weekend trying to get an open source package to build. It only lists a few dependencies: https://github.com/openscad/openscad#prerequisites
2 of them gave huge issues, next to compiler incompatibilities with visual studio versions on different libraries.
And, as is tradition, one of the libraries that gave issues was boost.
Logged

Software engineer by trade. Game development by hobby.
The Tribute Of Legends Devlog Co-op zelda.
EmptyEpsilon Free Co-op multiplayer spaceship simulator
fluffrabbit
Guest
« Reply #38 on: October 02, 2019, 06:46:30 AM »

I think you're taking the wrong approach with OpenSCAD.

* Don't try to use MSVC for open source projects
* OpenSCAD has too many dependencies
Logged
michaelplzno
Level 4
****



View Profile WWW
« Reply #39 on: October 02, 2019, 02:18:09 PM »

This thread has been super helpful, thanks! I'm gonna try to learn how to use cmake.  Gentleman
Logged

Pages: 1 [2] 3
Print
Jump to:  

Theme orange-lt created by panic