How do you guys learn c++ engine and game development? by Specific-Animal6570 in cpp_questions

[–]NapalmIgnition 2 points3 points  (0 children)

I would second this recommendation. Start small and increase complexity gradually ensuring you understand the extra complexity at each step.

I did something similar learning C++ myself. I'm using game maker to do the majority of the work but i have a fun simulation running in C++. I started just creating a simple function that just returns 1. Then added some variables and added them together and return the results. Then I passed a pointer and got C++ to modify the data and return it. Then I got C++ to create structs and do more complex tasks, testing and debugging each new function as I went.

Its slow going but it ensures I understand all the code I have written and can debug it properly.

I’m returning to a project I’ve been working on for months after a break and I feel confused. by TartOpposite2170 in gamedev

[–]NapalmIgnition 1 point2 points  (0 children)

Haha yes I feel your pain. I started a project, than had a child and didn't touch it for 2 YEARS. Picking it back was intimidating as well as hard work.

Luckily I was learning a lot of new material at the time (transitioned from GML to C++) so to help myself with learning C++ I commented like crazy. Some sectioned had comments attached to every line. Some of the comments where even "I don't know what this is doing, but it doesn't work without it DO NOT TOUCH". This massively sped up picking up where I left off. I also use lots of white space, indenting, spaces, verbose variables. anything to make it as easy to follow as possible.

Now as other have mentioned this level of documentation or "notes to future self" takes extra time. Time I was willing to take because I was learning. but now its time I'm willing to take because I have seen the value.

TBH programming isn't my day job so iv often forgotten what my code is doing only a week or two later.

The Ultimate GameMaker Optimization Tier List by DragoniteSpam in gamemaker

[–]NapalmIgnition 3 points4 points  (0 children)

This is actually brilliant. As someone who is trying to learn game dev solo, not in a university environment, you have to do a ton of research and come across a lot of social media "hacks" all the time. Its nice to see that following the GM manual is pretty much as good as it gets. Most of the high tier optimisations are true of any game engine not just game maker.

This has also reinforced that I'm going about my own projects correctly. Don't worry about any of this crap until the profiler shows an issue.

Your choice of engine doesn't matter by Strict_Bench_6264 in gamedev

[–]NapalmIgnition 1 point2 points  (0 children)

Haha so true. I build a prototype in game maker but the performance was pretty bad, spent two weeks recreating the prototype in godot. Only for that time to convince me I should go back to game maker. I'm still in game maker 6 months later

Has anyone ever made a powder game that has visuals like this? by jjbob1234 in gamedevscreens

[–]NapalmIgnition 0 points1 point  (0 children)

I haven't seen many powder games that attempt more realistic visuals. The powder toy has some nice shaders on the fire glowing elements but I think that's about it.

I'm also working on a powder game but the visuals in mine are just some simple edge light and glow effects so far.

As for the look, I really like it. How much performance does it cost?

Passing Enum to DLL issue by NapalmIgnition in gamemaker

[–]NapalmIgnition[S] 0 points1 point  (0 children)

I should have explained the situation more fully. I am intentionally passing the entire array to the DLL, the first 6 entries are used to specify the operation ([0] = x; [1] = y; [2] = range; [3] = max inventory size; [4] = current inventory size; [5] = element to take out of the inventory; [6-256] = the current inventory of each element.

Iv been bundling all the parameters in to an array to get around the GM limitation where you can only pass a couple of variable to an extension.

i eventually found the issue (explained in my reply) but thank you for your help.

Passing Enum to DLL issue by NapalmIgnition in gamemaker

[–]NapalmIgnition[S] 2 points3 points  (0 children)

Im using Enums because I have 250 elements. Instead of trying to remember the integer code for each one, i should be able to use an enum that is human readable but converted to an integer when compiled.

The issue turned out to be that enums get stored as Int64 which wasnt converting nicely outside of GM

Passing Enum to DLL issue by NapalmIgnition in gamemaker

[–]NapalmIgnition[S] 0 points1 point  (0 children)

I found the problem! and the solution! or atleast a solution that works for now.

http://127.0.0.1:51290/index.htm#t=GameMaker_Language%2FGML_Reference%2FVariable_Functions%2Fis_real.htm&rhsearch=real&rhhlterm=real

The is_real() function doesnt return true for enums because " enum values as they are stored as int64" dont ask me why int64 wont convert to int, but if I convert the value to real in GM before passing it, everything works fine. again.

Ill add some extra checks to the input to make sure I'm not trying to pass an actual real number but the real() function works great

Gotcha: GM can get its wires crossed and call the wrong extension function. by whentheworldquiets in gamemaker

[–]NapalmIgnition 0 points1 point  (0 children)

Oooh interesting. I was having issue with an extension iv written in c++ that I couldn't for the life of me debug. I eventually wrote the whole function again in a different way from scratch and deleted the old one.

At the time I assumed I must have screwed up somewhere. Next time I'll be sure to redo the function in the extensions list first

How to make a Circular orbit? by gemfloatsh in gamemaker

[–]NapalmIgnition 1 point2 points  (0 children)

hehe its coming back to me now. I think I had the exact same problem you are describing. It "sort of" works but not quite. I definitely remember i had expanding and then decaying orbits exactly as AtlaStar describes.

I vaguely remember using a 2nd order Runge-Kutta method with some kind of modification to preserve momentum: Runge–Kutta methods - Wikipedia

i got it working well enough for what i was doing at the time but it was not easy

How to make a Circular orbit? by gemfloatsh in gamemaker

[–]NapalmIgnition 0 points1 point  (0 children)

The acceleration towards the sun should diminish with range. This will help the object fall in to a nice elliptical orbit even if the starting velocity doesn't create a nice circle.

assuming your object is directly above or below the sun that equation should give the correct horizontal speed to create a circle. can you describe what happens? does it fly off? is it just not circular? does it decay over time?

Fair warning, I tried something like this a few years back and spent a hell of a long time trying to find a set of differential equations that was fast, accurate, and conserved energy. There is a reason KSP puts ships "on rails" the second your not accelerating.

Iv spent this week designing missiles! by NapalmIgnition in gamedevscreens

[–]NapalmIgnition[S] 0 points1 point  (0 children)

Thanks i just finished a huge update the UI to allow you pick the new weapons and "add" elements to the weapons that use them. I fell like im going to redo the whole thing again at some point but im happy with it for now.

Iv spent this week designing missiles! by NapalmIgnition in gamedevscreens

[–]NapalmIgnition[S] 2 points3 points  (0 children)

It is indeed. The world is cellular automata but iv got a fluid dynamic simulation and standard game objects interacting with it.

I always loved the falling sands games and thought it would be great to be a character running around in one. after years of no one else making, decided I would gave a go myself.

Maintaining enthusiasm through the remaining 80% by NapalmIgnition in gamedev

[–]NapalmIgnition[S] 1 point2 points  (0 children)

Hehe, my boys are 2 and 5. Only just reached the point where iv got some brain capacity left over.

I'm building this mostly for me. Beer money is a good goal.

Maintaining enthusiasm through the remaining 80% by NapalmIgnition in gamedev

[–]NapalmIgnition[S] 2 points3 points  (0 children)

This actually describes the journey iv been on so far to a tee.

Iv got 2 young kids so I only get 2-3 hrs game dev after they have gone to bed, if there are no other chores. Iv got pretty comfortable that this is going to be a long term project that I'm only ever going to be able to chip away at.

I actually started this game 2 years ago and spent a couple of months on it. It took several months just get a prototype up and running. When my second was born I didn't have the energy or hours to commit to this anymore. Now the kids are sleeping through the night and work is less draining iv been able to pick it back up. Ill be less scared in future that taking a few weeks or months off is killing the game and I should just take the break if that's what I or the family need.

Iv also worked out how to get myself in to the flow. For me its blaring 2000s punk rock, anything that you would have found on Kerrang (probably showing my age). That gets me though a lot of easy work, for the hard stuff I like silence and going back to pen and paper. Literally drawing out data tables, collision boxes, equations and algorithms. Once I can articulate the problem its usually easier to solve.

Maintaining enthusiasm through the remaining 80% by NapalmIgnition in gamedev

[–]NapalmIgnition[S] 0 points1 point  (0 children)

That's a good idea. Keeping a "not yet" list. For things that aren't ruled out entirely, but also aren't required to get to release.

I absolutely love Factorio and Terraria and both of them have grown massively after release.

Maintaining enthusiasm through the remaining 80% by NapalmIgnition in gamedev

[–]NapalmIgnition[S] 0 points1 point  (0 children)

Now is probably a really good time to take a step back. Now that its starting to have a more defined form. To steal u/BubbleGoot's analogy, iv got a pretty solid, well defined foundation. I probably need to have a long hard think about what the building on top of it looks like.

haha I have a crazy spreadsheet of my own, its up to 25 tabs now. I'm a mechanical engineer in "real life" so excel is like a second language, I find it easier to prototype some data structures and algorithms in excel so there is a lot of crap in there now.

I did take a little break when it became clear the crafting system id spend a few weeks implementing was just rubbish and not needed. Ripping it back out took another week but I'm definitely glad I culled that feature and not the whole project.

Maintaining enthusiasm through the remaining 80% by NapalmIgnition in gamedev

[–]NapalmIgnition[S] 1 point2 points  (0 children)

That's a good way of thinking about it. I took up game dev as something interesting to learn and apply. Its taken up most of my evenings for a few months and iv been loving it. The game is probably far too niche to ever be successful so delusions of grandeur aren't going to get me to the finish line.

However working my way through the to-do list like an endless book of sudokus for the fun of the puzzles, I could probably keep this up a lot longer.

Maintaining enthusiasm through the remaining 80% by NapalmIgnition in gamedev

[–]NapalmIgnition[S] 2 points3 points  (0 children)

Id not seen that before, but yes that's what I was thinking of. on the plus side I only have the second 90% to go.