Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Shalinor
Jun 10, 2002

Can I buy you a rootbeer?

Rocko Bonaparte posted:

My real sore spot is that I'm using ProBuilder for level editing. That has worked out pretty well, but it now leaves me with a sack of GameObjects that it has created. If there's a convenient way to move that stuff in and out while being able to edit it, then I'm all ears. I can think of creating a UI extension that swaps in and out all GameObjects implement ProBuilder stuff, as well as supporting stuff that I know is level-related, and just use serialization for it. I guess that would let me move things in and out to edit them, right?

Edit: ProBuilder is a plugin for Unity. I was not finding anything else that worked really well for slapping out the kind of basic levels I wanted to have for a top-down 2.5d action RPG.
You can turn the ProBuilder-made stuff into a prefab, and then Instantiate the prefab wherever you want it to be. If you wanted to load it differently / on-demand, you'd end up with a scene (or scenes) where the ProBuilder geometry lived as though it were a level, set up as prefabs, and you'd go in there, edit, test, etc, then Apply and update the prefab changes before going back to your real scene. Also good if you want to use the ProBuilder stuff as building blocks, instead of all being unique geometry.

Mind you, I'm not actually saying you should do this. If levels-as-scenes is working for you, there really isn't much of a reason to stop doing that. I'm glad we don't have to do that anymore, but we're a proc-gen game playing by different rules. Content-driven, level-based, that's just kinda your default, unless you want to blow a lot of extra time on tools. They sped Instantiate() up in 5.x, but it's still not exactly a fast operation.

(EDIT: it IS, however, a good trick to use your ProBuilder stuff in prefab form as building blocks, just because it could save you some time overall - you'd still be doing levels-as-scenes, but might be nicer than trying to hand-model it all from nothing... that should be pretty safe, too, whereas I'm not actually sure if ProBuilder would like being runtime-instantiated from a prefab)

Shalinor fucked around with this message at 01:08 on Aug 23, 2016

Adbot
ADBOT LOVES YOU

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!
ProBuilder has been pretty easy to use, so I am not too concerned. Fortunately, I figured out how to have multiple scenes open in the editor. So it is easy enough to get continuity between scenes as well create palette scenes for prefabs if it does become a big deal.

I also realized in all this that with Unity 5, I can play with all the lightmapping doodads, no questions asked.

A LOVELY LAD
Feb 8, 2006

Hey man, wanna hear a secret?



College Slice
Could someone tell me how Im being an idiot here?

Essentially put i want the 2 points to always be at the same distance from one another regardless of angle so its meant to get the direction between them and then place the moving point at cos/sin(angle)*distance.

However if you look at my fiddle the value jumps about.

https://jsfiddle.net/bwxqhhbm/3/

SupSuper
Apr 8, 2009

At the Heart of the city is an Alien horror, so vile and so powerful that not even death can claim it.

A LOVELY LAD posted:

Could someone tell me how Im being an idiot here?

Essentially put i want the 2 points to always be at the same distance from one another regardless of angle so its meant to get the direction between them and then place the moving point at cos/sin(angle)*distance.

However if you look at my fiddle the value jumps about.

https://jsfiddle.net/bwxqhhbm/3/
The value keeps jumping about because everytime point2 hits the groundpoint threshold it resets. Also shouldn't it be pointDirection(point1_x,point2_x,point1_y,point2_y)?

Maybe it would be better if you explained what you were trying to accomplish. A pendulum?

A LOVELY LAD
Feb 8, 2006

Hey man, wanna hear a secret?



College Slice

SupSuper posted:

The value keeps jumping about because everytime point2 hits the groundpoint threshold it resets. Also shouldn't it be pointDirection(point1_x,point2_x,point1_y,point2_y)?

Maybe it would be better if you explained what you were trying to accomplish. A pendulum?

The point direction was a typo yeah. Still has a similar result when its correct tho.

To explain what im doing think of lunar lander but you can land anywhere on random terrain. E.g if you just dropped down onto a hill and the left foot landed first then the right foot would continue to fall and would pivot around where the left foot was touching the ground. The feet need to stay the same distance from one another at all times.

Here's a lovely image.

http://imgur.com/a/mqUpL

Tiler Kiwi
Feb 26, 2011
Just want to gush a bit cuz I'm feeling pretty happy and it's thanks to people linking helpful things.

Holy moly setting up interfaces ahead of time and doing Dependency Injection via constructors makes building objects with dependencies a real loving breeze.

Like instead of having to start from some ground zero and build everything via one long stream of consciousness that falls apart into some ugly train wreck the moment things don't fall into place correctly, I can just write up a bunch of interfaces and go ahead and implement whatever thing I feel like and everything just sort of flows together like butter. If something breaks, its no mystery whats breaking or where the error is. There's no wrangling with having to think a whole bunch about program logic because I can just pretend everything I need is already there and implemented and Visual Studio is just happy to go along with it as long as I'm calling at some interface it has been properly pointed to, so I can just test things at a leisurely pace instead of having to run off to gently caress with UI or input things in the middle of some other problem.

Like this is my first real foray into really setting up an architecture for a program as opposed to just shoving things into the main and man, it's a whole different feeling. It's like some sort of dream logic where I just sort of wave my arms and the world just sort of goes along with it.

Can't wait until I run into my next headache and everything collapses.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Tiler Kiwi posted:

Just want to gush a bit cuz I'm feeling pretty happy and it's thanks to people linking helpful things.

Holy moly setting up interfaces ahead of time and doing Dependency Injection via constructors makes building objects with dependencies a real loving breeze.

Like instead of having to start from some ground zero and build everything via one long stream of consciousness that falls apart into some ugly train wreck the moment things don't fall into place correctly, I can just write up a bunch of interfaces and go ahead and implement whatever thing I feel like and everything just sort of flows together like butter. If something breaks, its no mystery whats breaking or where the error is. There's no wrangling with having to think a whole bunch about program logic because I can just pretend everything I need is already there and implemented and Visual Studio is just happy to go along with it as long as I'm calling at some interface it has been properly pointed to, so I can just test things at a leisurely pace instead of having to run off to gently caress with UI or input things in the middle of some other problem.

Like this is my first real foray into really setting up an architecture for a program as opposed to just shoving things into the main and man, it's a whole different feeling. It's like some sort of dream logic where I just sort of wave my arms and the world just sort of goes along with it.

Can't wait until I run into my next headache and everything collapses.

Just wait until you decide to rewrite something and are able to run the old and new implementations side-by-side. :unsmith:

rarbatrol
Apr 17, 2011

Hurt//maim//kill.

leper khan posted:

Just wait until you decide to rewrite something and are able to run the old and new implementations side-by-side. :unsmith:

Not so much a game development anecdote, but writing unit tests, replacing a component, and seeing that all the tests still pass is a really nice feeling.

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!
Does anybody know if Unity GameObjects in a scene loaded with SceneManager.LoadScene are immediately available? I am dabbling with a convention of migrating player data over to a new scene with something like this:

code:
            GameObject globalState = GameObject.Find("Global Game State");
            Object.DontDestroyOnLoad(globalState);
            SceneManager.LoadScene(newSceneName);
            var playerEntrance = GameObject.Find(entranceName);
            var player = GameObject.Find("/Global Game State/Player");
            player.transform.position = playerEntrance.transform.position;        
            // TODO: Re-orient player according to entrance rotation.
I've put all the information I want to carry over under an empty "Global Game State" object, which includes the player, the InControl GameObject, and that junk. I figured of all things that retrieving that would screw up, but it's actually botching getting the entrance object from the new scene. I just have an empty GameObject in the new scene where I want to put the player. It can't draw it out by name for whatever reason, and rather just gives me a null object.

I don't know if this is a good way to do things yet, but it seemed like a reasonable first step.

dreamless
Dec 18, 2013



Rocko Bonaparte posted:

Does anybody know if Unity GameObjects in a scene loaded with SceneManager.LoadScene are immediately available?

If I remember right, the actual load doesn't happen until the end of the frame. But I mostly use LoadAsync.

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!

dreamless posted:

If I remember right, the actual load doesn't happen until the end of the frame. But I mostly use LoadAsync.

I'll do the old "set a boolean so Update() knows to do a one-shot thing." Is there some nice built-in for doing that? I just hate having to declare one-shot stuff like that. Another place where I have to do it is in-game GUI stuff. If the player is opening their inventory with the inventory button, and the same button possibly closes it, I have to do a frame-to-frame check if they let go of that button at least once since they opened the inventory. Otherwise, it just immediately closes the GUI on the next frame. I'm finding that kind of temporal stuff to be messy.

Bongo Bill
Jan 17, 2012

rarbatrol posted:

Not so much a game development anecdote, but writing unit tests, replacing a component, and seeing that all the tests still pass is a really nice feeling.

When that happens to me, I become gripped with a terrible fear that my tests aren't asserting anything useful.

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!

Bongo Bill posted:

When that happens to me, I become gripped with a terrible fear that my tests aren't asserting anything useful.

Just curious, but has that proven itself true? It hasn't been an issue for me in tests I've written, and I doubt for your own tests too, but I can imagine other people's tests could be a thing. Like, I'm sure we've all seen people that pattern unit testing after the typical example they saw online. I'm talking about "the cat object's speak function returns 'Meow'" or some dumb stuff. Those are really the most useless tests in the world. I wish they wouldn't give examples like that.

Zero The Hero
Jan 7, 2009

Is there a good place to download example unity projects so I can learn from them?

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Zero The Hero posted:

Is there a good place to download example unity projects so I can learn from them?

If you just want the basics, there are tutorials available on the official website.

If you want to get better at structuring real projects.. no? Different things work better/worse given scope of project and number of contributors. A good understanding of how to structure projects generally is applicable. See the bookchat from a few pages ago (or was that the other thread?)

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!

dreamless posted:

If I remember right, the actual load doesn't happen until the end of the frame. But I mostly use LoadAsync.

It needs a lot of work--and the whole thing might get crumpled and thrown in the can--but it does function right now.

I just wanted to update that waiting until the next frame seems to have worked:
code:
    public string newSceneName;
    public string entranceName;
    private bool triggered;

    void OnTriggerEnter(Collider other)
    {
        if (!triggered)
        {
            Debug.Log("Loading new scene!");
            if (newSceneName != null)
            {
                GameObject globalState = GameObject.Find("Global Game State");
                Object.DontDestroyOnLoad(globalState);

                // This party ain't over quite yet (see Update() for extra operations)
                Object.DontDestroyOnLoad(this);
                SceneManager.LoadScene(newSceneName);
                triggered = true;
            }
        }
    }

    void Update()
    {
        // Run if:
        // 1. The player triggered the level change and the trigger code already ran to load that scene.
        // 2. The scene is finally loaded. Update() seems to get called before that happens.
        if (triggered && SceneManager.GetActiveScene().name == newSceneName)
        {
            var player = GameObject.Find("/Global Game State/Player");
            var playerEntrance = GameObject.Find(entranceName);
            player.transform.position = playerEntrance.transform.position;
            // TODO: Re-orient player according to entrance rotation.
            GameObject.Destroy(this);
        }
    }

It didn't work until I also checked we were in the new scene. So I guess most of gamedev may be unromantic, infrastructural crap, and then the rest of it is maintaining order of operations in the engine. I guess that is also unromantic, infrastructural crap.

Zero The Hero
Jan 7, 2009

leper khan posted:

If you just want the basics, there are tutorials available on the official website.

If you want to get better at structuring real projects.. no? Different things work better/worse given scope of project and number of contributors. A good understanding of how to structure projects generally is applicable. See the bookchat from a few pages ago (or was that the other thread?)

No, I'm looking for whole projects, not just a tutorial.

Ranzear
Jul 25, 2013

rarbatrol posted:

Yeah... Definitely profile first, and then make performance optimizations. There's almost always a #1 most expensive function that you can attack - and actually get something tangible for doing so.

Turns out generating 300x300 to 900x900 pngs of various circular gradients on demand and then drawing them per frame can be expensive. Who knew?

Ranzear fucked around with this message at 22:08 on Aug 24, 2016

orenronen
Nov 7, 2008

Rocko Bonaparte posted:

I'll do the old "set a boolean so Update() knows to do a one-shot thing." Is there some nice built-in for doing that? I just hate having to declare one-shot stuff like that. Another place where I have to do it is in-game GUI stuff. If the player is opening their inventory with the inventory button, and the same button possibly closes it, I have to do a frame-to-frame check if they let go of that button at least once since they opened the inventory. Otherwise, it just immediately closes the GUI on the next frame. I'm finding that kind of temporal stuff to be messy.

A more readable way of doing the same thing is to call a Coroutine that yields until the next frame and then does its thing. I've also grown to love UniRX (the Unity version of the Reactive Extensions library) to do this kind of tasks with style, but there's a high learning curve there.

Ranzear
Jul 25, 2013

Rocko Bonaparte posted:

I just hate having to declare one-shot stuff like that. Another place where I have to do it is in-game GUI stuff. If the player is opening their inventory with the inventory button, and the same button possibly closes it, I have to do a frame-to-frame check if they let go of that button at least once since they opened the inventory. Otherwise, it just immediately closes the GUI on the next frame. I'm finding that kind of temporal stuff to be messy.

Just compare current key state to a stored last-frame keystate.

Short version:
code:
// 1 = pressed, 0 = not pressed
if (keystate > lastkeystate) {
	// Just pressed
} else if (keystate < lastkeystate) {
	// Just released
}
lastkeystate = keystate
I prefer callbacks on key state change rather than per-frame polling for this very reason, but whatever you gotta do.

xzzy
Mar 5, 2009

Anyone got any familiarity with any open source/free beer version control software for binary data? My need isn't strictly game related but it's a similar problem that game artists have.. I need to store a few thousand images up to 20mb in size each plus metadata, then allow people to check parts of it out, edit it, and submit the changes. Locking a tree on checkout would be a nice bonus but isn't a firm requirement.

From what googling has shown me the proper term for this kind of software is "digital asset management" but that brings in a whole ton of enterprisey cloud solutions with fancy web frontends and database backends. That seems overkill for me as I'd be happy with something that works like git, has a cli interface, and doesn't toss cookies when you add 50gb of images.

Supposedly svn does okay with lots of binary data, anyone tried it?

MrBadidea
Apr 1, 2009

xzzy posted:

Supposedly svn does okay with lots of binary data, anyone tried it?

Short of being able to wrangle your way into the free licences for Plastic, SVN probably is your best bet. You could also look into git lfs.

I use SVN to manage distribution of a customised & minified version of UE4, plus other repos for the actual game projects, and it does pretty well handling like 8gb of binary assets for that.

Ranzear
Jul 25, 2013

Mercurial handles binary files rather well. I had it pushing a whole UDK install around a long while back, and currently shove all my sprites and MP3s through it. Dunno about checkout though. I've only barely graduated from making it auto-Update on every Push.

Ranzear fucked around with this message at 05:10 on Aug 25, 2016

orenronen
Nov 7, 2008

xzzy posted:

Supposedly svn does okay with lots of binary data, anyone tried it?

My company uses SVN for source control, and our repository contains several dozen gigabytes of binary asset files. It works reasonably well.

SVN is a pain in every other way, though.

return0
Apr 11, 2007
Every games project I've worked with has used either Perforce, SVN, or more recently git-lfs for large assets.

dupersaurus
Aug 1, 2012

Futurism was an art movement where dudes were all 'CARS ARE COOL AND THE PAST IS FOR CHUMPS. LET'S DRAW SOME CARS.'
We use perforce at my company, and it works fine for the artists. Just be prepared to be able to host a huge repository somewhere.

Shalinor
Jun 10, 2002

Can I buy you a rootbeer?

return0 posted:

Every games project I've worked with has used either Perforce, SVN, or more recently git-lfs for large assets.
git-lfs is poised to be The One Everyone Uses. Specifically, via Bitbucket. I've heard not great things about other implementations, but Bitbucket is churning along to being the solid, reliable choice. I'm not sure if it's there yet, given that it's still in beta, but in the next year, probably yes.

xzzy
Mar 5, 2009

git-lfs scared me off with the way it doesn't actually store your binary data in the repo, but "somewhere else" that needs to be configured and maintained separately. That doesn't feel like a repository to me anymore, it's an infrastructure. git-annex was another option I looked at, but does basically the same thing. rsync is an option for the backend, and I love rsync, but again I don't think it can be called a "repository" at that point.

Which is how I got where I'm at now.. looking for a VCS that actually handles binary data well. Subversion gets pretty high marks and I'm doing tests with it now to verify suitability. I've used it for small code repositories in the past and never had much of an issue with it, so we'll see. I just figured it was worth asking around if there's some other hot new approach to binary data that I hadn't found yet.

Unperson_47
Oct 14, 2007



Every time you guys bring up the topic of VCS, no one else mentions using Mercurial and it makes me think I'm doing something wrong. :ohdear: (I'm using it via SourceTree)


Edit: Nevermind, I'm dumb - not even 5 posts before mine:

Ranzear posted:

Mercurial handles binary files rather well. I had it pushing a whole UDK install around a long while back, and currently shove all my sprites and MP3s through it. Dunno about checkout though. I've only barely graduated from making it auto-Update on every Push.

Unperson_47 fucked around with this message at 19:15 on Aug 25, 2016

Ranzear
Jul 25, 2013

Because we're dirty heathens who don't need no web-front for our repos.

I might have to try SourceTree over Tortoise though. I assume it's better than a glorified GUI for Putty.

ZombieApostate
Mar 13, 2011
Sorry, I didn't read your post.

I'm too busy replying to what I wish you said

:allears:
I dumped SourceTree a while back because it got gradually more buggy until I got fed up with it and went back to GitExtensions, which isn't as pretty but at least I don't feel like I'm alpha testing it. Maybe they cleaned it up since then, but I don't care or really trust them anymore, so meh.

Shalinor
Jun 10, 2002

Can I buy you a rootbeer?

Ranzear posted:

Because we're dirty heathens who don't need no web-front for our repos.

I might have to try SourceTree over Tortoise though. I assume it's better than a glorified GUI for Putty.

I'm a huge fan of Sourcetree, but I'm a dirty heathen that turns my nose up at *nix and all things command line, so your mileage may vary.

MrBadidea
Apr 1, 2009

ZombieApostate posted:

I dumped SourceTree a while back because it got gradually more buggy until I got fed up with it and went back to GitExtensions, which isn't as pretty but at least I don't feel like I'm alpha testing it. Maybe they cleaned it up since then, but I don't care or really trust them anymore, so meh.

The OSX version of SourceTree is still pretty amazing. It's just absolute poo poo on Windows and rapidly getting worse.

Ranzear
Jul 25, 2013

MrBadidea posted:

It's just absolute poo poo on Windows and rapidly getting worse.

Noted. Tortoise Workbench is basically a bigass 'push all this crap to the server' button for me at this point, so I can skip having cmd open. I have a bit of a *nix allergy for my main box too.

Caliber was never a big enough deal to worry about pushing broken code, but on my next project I plan to push to a test server/repo which automatically re-pushes to (but not updates) the live version and resets its own server. The hgrc hooks for this are so stupid simple:
code:
[hooks]
changegroup.a = hg update
changegroup.b = hg push live
changegroup.c = supervisord stop elimtest
changegroup.d = supervisord start elimtest
So then, with supervisord set up and a little json config file defined in both test and live, I'll just go to test.elimination.zone to see my latest junky code running on its own port, but regular elimination.zone will churn right along. Then the live version gets:
code:
[hooks]
update.a = supervisord stop elim
update.b = supervisord start elim
So as soon as I manually hg update it to some stable version (without ever needing to push twice), the live server also auto-restarts. All because I don't want to deal with running a local version of this monstrosity of a stack or deal with detached screens anymore.

That's Mercurial in a nutshell to me. I use it more like version keeping (as in "oh poo poo, I need the old version of that function to fix this") rather than version control. This setup will let me do my usual code flogging in peace and give me a reason to make descriptive commit messages so I can sum up a proper update.

"Which VCS should I use?" depends more on you than the vagaries of each.

everythingWasBees
Jan 9, 2013




Sourcetree was kind of a pain on Windows. Like it worked well most of the time but at times parts of it would just lock up or stop working or it wouldn't update info correctly and when you're dealing with all the potential weirdness that a new team learning to properly use version control can bring, the application adding to it was too much at times.

DoubleCakes
Jan 14, 2015

They told me the room editor in GameMaker was bad but I rolled my eyes and assumed they exaggerating.

But I have been working with the room editor for some time now and it is bad.

Yodzilla
Apr 29, 2005

Now who looks even dumber?

Beef Witch

MrBadidea posted:

The OSX version of SourceTree is still pretty amazing. It's just absolute poo poo on Windows and rapidly getting worse.

It's actually the opposite for me. SourceTree is rock solid on Windows but crashes multiple times a day on OSX and they never seem to update that version.

It looks like GitKraken is trying to eat their lunch too.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Yodzilla posted:

It's actually the opposite for me. SourceTree is rock solid on Windows but crashes multiple times a day on OSX and they never seem to update that version.

It looks like GitKraken is trying to eat their lunch too.

I dunno, whenever I need to figure something out I just
code:
$ man git
There's pictures and everything.

The GUIs are all bad and either missing useful features or make doing simple things really complicated.

xgalaxy
Jan 27, 2004
i write code
I swear by SmartGIT myself. But it costs money.

Adbot
ADBOT LOVES YOU

Ranzear
Jul 25, 2013

leper khan posted:

The GUIs are all bad and either missing useful features or make doing simple things really complicated.
One reason: Editor behavior on Windows when writing a commit. gently caress that noise. Being able to scroll down a couple hundred commits and immediately see the diff is nice too.

I'm all command-line on the server (Ubuntu), but hgrc hooks do 90% of the work there.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply