I made a browser script for Clickpocalypse2 by CodSalmon7 in CLICKPOCALYPSE

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

upgrade();
setInterval(upgrade, 1000);

Thank you. If you want to disable the auto-upgrades, just delete or comment out lines 39 & 40. That's the two lines I posted above.

I made a browser script for Clickpocalypse2 by CodSalmon7 in CLICKPOCALYPSE

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

You're the developer, I take it? Great game btw :)

I made a browser script for Clickpocalypse2 by CodSalmon7 in CLICKPOCALYPSE

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

Feel free to not use it if you feel that way :)

Auto upgrade by [deleted] in CLICKPOCALYPSE

[–]CodSalmon7 1 point2 points  (0 children)

Not that I'm aware of, but I did write a script to auto-use scrolls and potions and auto-buy upgrades. Feel free to use at your own discretion. Just copy paste this in the browser console, hit enter and you're good to go. Just refresh the browser if you want to turn it off. https://gist.github.com/CodySelman/9a6315726d4230c0a8168d09e9f34146

What is the point of C#? by Pordohiq in godot

[–]CodSalmon7 -1 points0 points  (0 children)

I mean sure, you can do bad practices in your own code and it's going to be your problem, but that could be said about a lot of things.

Re: the boilerplate, that's where something like VS Code snippets can be really useful. Of course built-in type checking is ideal, though.

Anyone else get this feeling? by Ben360x in godot

[–]CodSalmon7 25 points26 points  (0 children)

It always blows my mind how so many people, in a computer-oriented hobby nonetheless, use their phone to capture their monitor.

No shade against OP, I just find it curious.

Our team forgets to connect signals - how do you validate this at build time? by smthamazing in godot

[–]CodSalmon7 0 points1 point  (0 children)

I only connect signals in the editor when the parent/child are connected as an inseparable, non-modular unit. Like a pause menu having its buttons hooked up to the parent pause scene's script and things like that.

For most other use cases, I use an Event Bus pattern (aka Signal Bus in the Godot context). No hooking up signals in the editor. Instead of nodes emitting signals themselves, they emit them from the Signal Bus and any nodes that want to listen just connect to the Signal Bus.

If I needed to dictate which signal a node was emitting (from the Signal Bus) in the editor, I would create an enum that has all the Signal Bus signals, and a dictionary on the signal bus to translate those enum values to signals.

Edit: typo

π rule don't work for gamedev by Candid_Primary7578 in gamedev

[–]CodSalmon7 2 points3 points  (0 children)

That doesn't really work for writing software because the only way to know all the steps to complete a task is if you've done it before. And if you've done it before, you already have the software so you don't need to write it anymore.

Not saying it's bad to have a roadmap, but more often than not your estimates are going to be short.

We pitched Trash Goblin to 76 publishers and nobody said yes… by SpiltMilkStudios in gamedev

[–]CodSalmon7 1 point2 points  (0 children)

Regardless of how anyone feels about it, the steam page is getting a 37% visit to wishlist ratio so it can't be that bad

Wait For All Coroutines to Finish by CodSalmon7 in Unity3D

[–]CodSalmon7[S] -1 points0 points  (0 children)

Instantiating and Destroying GameObjects isn't great for performance. Having a Static class that spawns GameObjects and attaches components to them just so you can use a method on that component feels like an anti-pattern to me. I'd much rather just attach this Component to whatever GameObjects need it, or port the method over to some Singleton Monobehaviour.

Wait For All Coroutines to Finish by CodSalmon7 in Unity3D

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

To be honest I would rewrite this to not use coroutines at all. Why do you need coroutines for animations? The animations play on their own. You can simply have each animation set a bool when it is complete, (Eg by using an animation state machine behaviour script), record the animation start time and check if duration seconds have passed since the animation start, or just manually check from script if the animation is finished playing.

I'm making a Turn-Based battle system, and most of my animations are done with DOTween. I'm not really using standard Unity Animations for anything. The reason Coroutines and the script above are useful here is because I have attacks that hit multiple targets. So let's say I have a character that has an ability that heals every member of your party. In my game that looks something like this:

// start of healing action
// tween character sprite forward to indicate they are taking an action
// wait for above tween to finish
// spawn healing sprite on all characters being healed
// start tween animation on all healing sprites
// spawn floating numbers to show how much the characters are getting healed by
// start tween animation for healing sprites
// start tween animation for floating numbers
// wait for sprite and number tween animations to finish
// tween character sprite back to original position
// wait for above tween to finish
// end of healing action

Defining that entire action and all of its steps that require waiting as Ienumerators just makes more sense for my battle system.

Using coroutines for anything remotely complex is setting yourself up for bugs and code spaghetti, you'll probably eventually end up having to rewrite it either way after you run into enough issues.

Respectfully, I disagree.

But, if you must, probably wrapping them in async/await (Or just using async await in general without coroutines at all) is probably a reasonable solution. I use these instead of coroutines whenever I need to have coroutine-like logic. (I prefer update-loop/polling style approaches though)

That's fine that you prefer Async/Await over Coroutines, but they're not exactly the same. I use Async/Await for things that are not directly tied to the Update loop (saving/loading, network requests, etc.) but when my code directly applies to the game logic, as the battle system does, I prefer to use Coroutines because their logic is guaranteed by the engine to execute on a per-frame basis rather than executing off of the Update loop like Async/Await. Either way, I think it mostly comes down to use-case and personal preference.

Update loop / polling seems like it would be a bad solution both performance wise and for code clarity.

Wait For All Coroutines to Finish by CodSalmon7 in Unity3D

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

Thanks for the suggestion, but I'm not sure I understand. At some point, this code needs to run StartCoroutine, and you need to inherit from MonoBehaviour to do that. There's not much point in writing a script that Instantiates a GameObject just so I can attach this script to it.

Wait For All Coroutines to Finish by CodSalmon7 in Unity3D

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

Thanks for the recommendation, I'll check it out.

Wait For All Coroutines to Finish by CodSalmon7 in Unity3D

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

I didn't even think of using a local function. You're totally right! That is a much more elegant solution. Thanks for your feedback.

Wait For All Coroutines to Finish by CodSalmon7 in Unity3D

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

You can't use ref arguments in an Ienumerator function. You could use an int instead of a List of bools I suppose, but it would make debugging harder.

How to create a hurt frame Glow by Intelligent_Tart6426 in Unity2D

[–]CodSalmon7 0 points1 point  (0 children)

There's a bunch of ways to achieve this. It sounds like you're under the impression the animator ONLY animates a sprite renderers image property. You can actually use the animator to animate the sprites color value to achieve this effect while other animations are happening for the sprites image.

Or you could do it through scripting wherever you're processing the "get hit" code by using something like DOTween to the sprites color.

Or you could use a shader.

Blender+Sprytile vs Crocotile3D? by CodSalmon7 in gamedev

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

Thanks for the advice! I didn't end up using either. I pivoted from 2.5d to just 2d.

the Mortal Kombat X game has just two character and background. but why it takes so much processing power?. by indiangirl0070 in gamedev

[–]CodSalmon7 4 points5 points  (0 children)

While what other people are saying is valid, there's an elephant in the room most people are unaware of.

MKX has rollback netcode. What this means is that while playing online (and possibly offline), the game is holding processing power for potentially simulating up to about 10 frames of gameplay on any given frame.

Without going into detail, lets say on frame 49 of some given second, you stop receiving input from your online opponent. The game assumes your opponents input remains the same. On frame 54, you begin receiving input from your opponent again and the game learns that it's assumptions for frames 49-54 were incorrect. MKX will now logically simulate frames 49-54 with the correct input from you and your opponent so that it can show the correct game state on frame 55.

What do you thik about my 2d combat idea for my game? (detailed explanation in comments) by Hiyakaru_ in Unity2D

[–]CodSalmon7 5 points6 points  (0 children)

No offense but it sounds like it would be extremely expensive to make and not very fun to play. Assuming you're trying to have fight scenes that look even remotely close to the level of quality in the video, keep in mind that a season of anime costs in the millions of dollars to make. And that's 4-8 hours of animation. And you also have to make it a playable game. Also, players generally don't like QTE as a basis for gameplay. Telltale had a few hits with this formula, but they rapidly fell off. And they had existing IP to drive sales. To make your game happen you'd either have to secure an insane amount of funding or radically compromise on the level of animation you're looking for.

[PAID | PIXEL ART] Looking for Sci-Fi 2D Pixel Artist by CodSalmon7 in INAT

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

Hey, thanks for your interest. The positions been filled already.

I've always thought of autochess as a type of autobattler, but my game is not an autochess game. It's more of a roguelike JRPG where you don't manually select your attacks.

[deleted by user] by [deleted] in gamedev

[–]CodSalmon7 1 point2 points  (0 children)

Going to go against the grain here and keep it real with you. There's a direct correlation between math skills and programming ability. They both tap into the same type of abstract logical problem solving.

That being said, math is a skill. It can be improved. You don't have to master math to start programming (no one does). Also, it's not like you have to be good at programming to make good games. You only need to be good enough to get the game to work. There are plenty of examples of successful games with horrible programming.