Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 777 778 [779]

Author Topic: if self.isCoder(): post() #Programming Thread  (Read 498830 times)

Ispil

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #11670 on: September 30, 2019, 02:09:45 pm »

Oh, he never suggested "don't use an engine." That'd be ridiculous.

More generally, many game engine features should really not ever be used outside of mockups or prototypes.

It's that some features tend to suck ass and shouldn't be used. Not that the engines themselves are useless. Unity's a perfectly fine engine. Just don't let it constrain you; if there's something in it that's doing nothing for you, don't feel obligated to use it anyway.

Or, more specifically, if Unity's menu system is giving you nothing but headaches and trouble, then don't use Unity's menu system. Set up your own system within Unity that avoids their nonsense, while still allowing you to use the bits of Unity that are good for your project.
« Last Edit: September 30, 2019, 02:12:33 pm by Ispil »
Logged
"Those who can make you believe absurdities can make you commit atrocities." - Voltaire

"I have never made but one prayer to God, a very short one: 'O Lord, make my enemies ridiculous.' And God granted it."- Voltaire

I transcribe things, too.

Reelya

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #11671 on: September 30, 2019, 08:08:16 pm »

Yeah, nobody even alluded to "roll your own engine" here. What was said / implied is don't only use the stock components. A good Unreal game has a ton of custom C++ behind it, those people aren't just wiring up prefabs from the noobie toolbox they give you.

That's the problem I alluded to. A lot of people just wire up the built-in components, because it's faster, then they wonder why their game is doing weird shit and they can't customize things to look and act like they want later.

The thing is: use Unity as a graphics engine, but don't literally build everything inside the game out of unity's GameObjects in the inspector. If you do that, you end up with a huge unwieldy monolith, a huge nested tree of GameObjects of various types, that's extremely hard to modify, and basically impossible to debug if things don't do what you want.

EDIT: For a more concrete example, consider something like building DF in Unity. If you make every creature a Unity "GameObject" with attached scripts, sprites, and animation frames, then each and every creature is running an update loop every frame. Even if they're not doing anything, even if they're not on the screen. instead, you could just model all the creatures as values in an array, and you only render what's necessary when needed. You lose the entire bulky overhead of inheriting from Unity's do-everything "GameObject" class for hundreds of your game-creatures.
« Last Edit: September 30, 2019, 08:22:16 pm by Reelya »
Logged

Parsely

  • Bay Watcher
  • She/her, they/them
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #11672 on: October 17, 2019, 02:46:26 pm »

I'm using a multimap in C++ but I only just found out late into this project that it doesn't preserve the order of insertion and that's important. It works as intended when there are only unique values but it looks like it rearranges the values when I insert a duplicate key and I don't want it to do that. I don't think I can control this behavior, so it looks like I'm going to have refactor all my code I guess

LoSboccacc

  • Bay Watcher
  • Σὺν Ἀθηνᾷ καὶ χεῖρα κίνει
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #11673 on: October 17, 2019, 02:59:18 pm »

you can add a sortable prefix to the key, depending on how the key is generated/stored
Logged

Parsely

  • Bay Watcher
  • She/her, they/them
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #11674 on: October 17, 2019, 03:21:12 pm »

Oh? I think I read something briefly about that but I found another solution. I was actually able to seamlessly swap it with a list of pairs since I was using iterators to index my data structures, all I had to do was change some types and it just worked as intended. I wasn't expecting to solve it this quick and I'm shocked that went so smoothly.

bloop_bleep

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #11675 on: October 17, 2019, 04:22:00 pm »

Yeah that sounds similar to what LoS was suggesting, with the second element of the pair being the key. Lexicographical comparison makes it work similar to a multimap.
Logged
bloop_bleep's Moving Fortress Parts Mod!

Quote from: KittyTac
The closest thing Bay12 has to a flamewar is an argument over philosophy that slowly transitioned to an argument about quantum mechanics.
Quote from: thefriendlyhacker
The trick is to only make predictions semi-seriously.  That way, I don't have a 98% failure rate. I have a 98% sarcasm rate.
Pages: 1 ... 777 778 [779]