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
Falcorum
Oct 21, 2010

BarbarianElephant posted:

"Game designer" definitely exists as a job, but it's not generally the "ideas guy" - they do things like designing levels, scripting quests, writing in-game text etc.

So i guess normally it's like being a coder but a little higher level.

I come from a small team world where there's no such thing.

Even in large teams, that's how it goes. Unless somehow you manage to magic pixie your way into being the lead designer, in which case you can mostly sit on your rear end all day and all successes/failures are attributed to you regardless of actual input on your part. :v:

Adbot
ADBOT LOVES YOU

KillHour
Oct 28, 2007


Falcorum posted:

Even in large teams, that's how it goes. Unless somehow you manage to magic pixie your way into being the lead designer, in which case you can mostly sit on your rear end all day and all successes/failures are attributed to you regardless of actual input on your part. :v:

This is called a manager.

FuzzySlippers
Feb 6, 2009

I think most RPGs have non-coding designers that mostly work in spreadsheets and try to wrangle all the numbers. Trying to make RPGs on my own I definitely underestimated how much of a job that stuff was.

Bongo Bill
Jan 17, 2012

The director of a game should have a background in at least one of the disciplines required for that game's production.

Boz0r
Sep 7, 2006
The Rocketship in action.
I'm doing a prototype of a Warcraft style RTS in Unity, and doing orders in a command pattern style.
How should I do composite commands, like a build command where the unit has to move before it can build? Should I have a command have a list of sub-commands or something?

Mata
Dec 23, 2003

Boz0r posted:

I'm doing a prototype of a Warcraft style RTS in Unity, and doing orders in a command pattern style.
How should I do composite commands, like a build command where the unit has to move before it can build? Should I have a command have a list of sub-commands or something?

Yeah you probably want to be able to compose higher level commands from sub-commands. That particular pattern (where you want to invoke some ability but your dude needs to reposition itself in order to satisfy that ability) is going to come up a lot, for example with attacking abilities also.

Mr Shiny Pants
Nov 12, 2012

Boz0r posted:

I'm doing a prototype of a Warcraft style RTS in Unity, and doing orders in a command pattern style.
How should I do composite commands, like a build command where the unit has to move before it can build? Should I have a command have a list of sub-commands or something?

Do a pipeline of Commands? And it executes them in order.

this way you can also make the player stack commands.

Boz0r
Sep 7, 2006
The Rocketship in action.

Mr Shiny Pants posted:

Do a pipeline of Commands? And it executes them in order.

this way you can also make the player stack commands.

Sure, but I figure I have to have sub-commands, since you can attack something that can move out of range, and you'll have to follow that thing.

HappyHippo
Nov 19, 2003
Do you have an Air Miles Card?
Having written an RTS before, my approach was something like this:

- I used a component system for my units. Different units need to mix and match features. For example, some units can move, some can't (buildings), while some units can attack and some can't. All these combinations can exist (tanks can move and attack, the builders can move but not attack, most buildings can neither move nor attack, but the turret can attack (but not move)), so taking the component approach definitely reduces code duplication
- The "builder" component has its own state machine (do nothing, build target, repair target). The "moveable" component also has it's own state as well, including a destination coordinate. All the builder does while in the "build target" state is set it's destination to be next to its target, and if it's adjacent to the target, actually increment the build progress of the target. The "moveable" component handles the actual business of moving towards the target, automatically pathfinding and moving as long as the unit is not at its destination.
- The attacking units work in a similar way, setting their destination to be within range of their target, and, if they're in range, attacking it. Again the "moveable" component handles the actual moving. The nice thing about this approach is that it automatically handles the case of the target moving out of range.

The command queue approach could get messy, as you'll have to start having the unit manipulate it's queue in order to handle changing situations. For example, if the queue is "move to target -> attack target", and then you get in range (so now it's "attack target"), and then the target moves out of range, now the unit will have to delete the current command and append "move to target -> attack target" again. That may be fine on its own, but once you add more commands and the queues start getting complex my hunch is that it'll start getting bug-prone. But that's just my opinion, maybe it'll work fine.

HappyHippo fucked around with this message at 21:00 on Aug 30, 2019

Boz0r
Sep 7, 2006
The Rocketship in action.
Good points, I'll have to check that out. If those two behaviors are independent, how would you handle a unit that needs to stop to fire, like some artillery?

Edit: Link's dead.

HappyHippo
Nov 19, 2003
Do you have an Air Miles Card?

Boz0r posted:

Good points, I'll have to check that out. If those two behaviors are independent, how would you handle a unit that needs to stop to fire, like some artillery?

Edit: Link's dead.

Sorry, phone posting, try again?

The artillery unit has its own component, with it's own state machine. The movement controller has a "freeze" toggle, the other components can use that to prevent movement. When the artillery is in the deployed/deploying states it sets the freeze toggle to true, when it's in the "packed" state it unfreezes movement.

Mata
Dec 23, 2003
I agree with what a lot of HappyHippo said and would like to add the suggestion to keep the components ideally as plain data and keep the state machine logic in serializable ability scripts/tasks, and using systems to coordinate higher level component behavior like steering. This also has the advantage that you don't have to update components that aren't actively doing stuff.
I have a really buggy RTS where each player input creates a command, for each unit the command creates an ability invocation, each ability invocation has an internal queue of tasks, so eventually you end up at for example the HarvestTask that has some updatable interface that's called 10 times per second or whatever
C code:

Update(Entity harvester){
  // make sure we get in range
  if (harvester.TryGetComponent<Movement>() is MovementComponent harvesterMovement && MovementSystem.FollowTarget(harvesterMovement, harvestTarget, harvestRange)){
     // do the harvest cycle
     if (harvester.TryGetComponent<Weapon>() is WeaponComponent harvesterWeapon && WeaponSystem.SwingWeapon(harvesterWeapon, harvestTarget)){
        // add harvest yield to inventory
        if (harvester.TryGetComponent<Inventory>() is InventoryComponent harvesterInventory){
          ResourceSystem.AddToInventory(harvesterInventory, harvestTarget.ResourceAmount);
          // Remove HarvestTask from task queue here because it's done
        }
     }
  }
}

I don't really know to what degree these concepts apply to unity, but it might be helpful idk! As I understand it coroutines kind of implement this pattern but in some weird hacky way.

Mata fucked around with this message at 22:04 on Aug 30, 2019

Mr Shiny Pants
Nov 12, 2012

Boz0r posted:

Sure, but I figure I have to have sub-commands, since you can attack something that can move out of range, and you'll have to follow that thing.

Have the AI issue a new command and stop what it is currently doing. You could make it that it continues doing something until a new order arrives. Like keep guarding etc. etc.

KillHour
Oct 28, 2007


Mata posted:

I agree with what a lot of HappyHippo said and would like to add the suggestion to keep the components ideally as plain data and keep the state machine logic in serializable ability scripts/tasks, and using systems to coordinate higher level component behavior like steering. This also has the advantage that you don't have to update components that aren't actively doing stuff.
I have a really buggy RTS where each player input creates a command, for each unit the command creates an ability invocation, each ability invocation has an internal queue of tasks, so eventually you end up at for example the HarvestTask that has some updatable interface that's called 10 times per second or whatever
C code:

Update(Entity harvester){
  // make sure we get in range
  if (harvester.TryGetComponent<Movement>() is MovementComponent harvesterMovement && MovementSystem.FollowTarget(harvesterMovement, harvestTarget, harvestRange)){
     // do the harvest cycle
     if (harvester.TryGetComponent<Weapon>() is WeaponComponent harvesterWeapon && WeaponSystem.SwingWeapon(harvesterWeapon, harvestTarget)){
        // add harvest yield to inventory
        if (harvester.TryGetComponent<Inventory>() is InventoryComponent harvesterInventory){
          ResourceSystem.AddToInventory(harvesterInventory, harvestTarget.ResourceAmount);
          // Remove HarvestTask from task queue here because it's done
        }
     }
  }
}

I don't really know to what degree these concepts apply to unity, but it might be helpful idk! As I understand it coroutines kind of implement this pattern but in some weird hacky way.

I wouldn't use GetComponent every frame. I'd cache the component in a field.

Edit: It's not that bad for performance, but here are some solid numbers so you can judge for yourself:

http://chaoscultgames.com/2014/03/unity3d-mythbusting-performance/

I'd cache it, if only so I could just type harvesterWeapon instead of wrapping it in an if...is assignment.

KillHour fucked around with this message at 23:06 on Aug 30, 2019

Mata
Dec 23, 2003

KillHour posted:

I wouldn't use GetComponent every frame. I'd cache the component in a field.

Edit: It's not that bad for performance, but here are some solid numbers so you can judge for yourself:

http://chaoscultgames.com/2014/03/unity3d-mythbusting-performance/

I'd cache it, if only so I could just type harvesterWeapon instead of wrapping it in an if...is assignment.

Ideally the gamestate update shouldn't be run on the same thread as the graphics stuff, and shouldn't update as frequently (10hz? 16-25 if you're an esport moba?) but it's primarily because of stuff like pathfinding, not dictionary lookups.
The problem with caching the components in the ability invocations or whatever is it's one more stateful place you need to keep valid, what if some unrelated event causes the harvester's weapon component to be removed or replaced? Storing lists of entities & components in various places has led to an insane amount of bugs for me.

I suggest getting a really robust & tight EntitySet/ComponentSet classes like the one described here that abstracts all cache invalidation bullshit away, and lets you write performant queries like "Entities that are in this region that belong to the enemy of this player that are not dead" and have that give you the correct set of entities every time you iterate over it.

Boz0r
Sep 7, 2006
The Rocketship in action.
Unity has their own ECS system in preview that I've tried a bit, and it seems cool, though the data oriented design takes some getting used to. Maybe I'll try converting to that.

Remora
Aug 15, 2010

Hey, dumb question. If I want to make a text-driven game with a lot of procgen stuff and a lot of remembering choices and events, and I have successfully prototyped it in Microsoft Access (it was basically on a dare, don't judge me), what kinda real software would be the logical next Real Game step?

I mean, this is mostly going to be designing menus - like I said, MS Access was up to snuff for the front end, but I would like a real executable that doesn't need either MS Access installed or that thing MS has that lets you run Access databases without Access but is like 300mb. Also something that lets you make *pretty* menus, which is a lot of work in Access because you don't get a lot of options and even the nice stuff looks like Amazon Trail for Grown-Ups.

I looked at Twine but I'm pretty sure it's *way* too simple. Unity?

Absurd Alhazred
Mar 27, 2010

by Athanatos

Remora posted:

Hey, dumb question. If I want to make a text-driven game with a lot of procgen stuff and a lot of remembering choices and events, and I have successfully prototyped it in Microsoft Access (it was basically on a dare, don't judge me), what kinda real software would be the logical next Real Game step?

I mean, this is mostly going to be designing menus - like I said, MS Access was up to snuff for the front end, but I would like a real executable that doesn't need either MS Access installed or that thing MS has that lets you run Access databases without Access but is like 300mb. Also something that lets you make *pretty* menus, which is a lot of work in Access because you don't get a lot of options and even the nice stuff looks like Amazon Trail for Grown-Ups.

I looked at Twine but I'm pretty sure it's *way* too simple. Unity?

Ren'Py is a good compromise, especially if you're comfortable with Python. I don't have a lot of experience with it myself but the various visual novel folks around here swear by it.

M2tt
Dec 23, 2000
Forum Veteran
If you're open to mobile gaming Android has a pretty good sqlite implementation by default so a lot of the access stuff should be copy pasteable. Beyond that I only know the UE4 has poo poo for good database options.

roomforthetuna
Mar 22, 2005

I don't need to know anything about virii! My CUSTOM PROGRAM keeps me protected! It's not like they'll try to come in through the Internet or something!

Remora posted:

I mean, this is mostly going to be designing menus - like I said, MS Access was up to snuff for the front end, but I would like a real executable ...
How would you feel about using HTML5/Javascript/Typescript? It can be wrapped up into a 'real executable' of sorts, and is definitely the super easiest of the easy for doing fancy text and menus.

Remora
Aug 15, 2010

roomforthetuna posted:

How would you feel about using HTML5/Javascript/Typescript? It can be wrapped up into a 'real executable' of sorts, and is definitely the super easiest of the easy for doing fancy text and menus.

Probably OK? I'd like to be able to release it on Steam at some point, I'm not sure exactly what that might entail.

Also - checked out Ren'Py and I think doing the procgen stuff I want in it is going to be a reasonably large pain.

The Fool
Oct 16, 2003


Curious expedition is an electron based game that was released on steam, so that would be fine.

Remora
Aug 15, 2010

Neato, Curious Expedition is a game I know. If Electron can do that, it ought to be able to do this. Thanks!

roomforthetuna
Mar 22, 2005

I don't need to know anything about virii! My CUSTOM PROGRAM keeps me protected! It's not like they'll try to come in through the Internet or something!

The Fool posted:

Curious expedition is an electron based game that was released on steam, so that would be fine.
Context in case you're not familiar, electron is a thing for wrapping Javascript in an executable.
Edit: Ah, you did know that. I didn't until like half an hour ago, so I thought it worth mentioning.

Nolgthorn
Jan 30, 2001

The pendulum of the mind alternates between sense and nonsense

Remora posted:

Probably OK? I'd like to be able to release it on Steam at some point, I'm not sure exactly what that might entail.

Also - checked out Ren'Py and I think doing the procgen stuff I want in it is going to be a reasonably large pain.

Well if you use a web framework to build your game you can wrap it into an executable, it doesn't need to run on the web. Might be a nice bonus later on.

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

M2tt posted:

If you're open to mobile gaming Android has a pretty good sqlite implementation by default so a lot of the access stuff should be copy pasteable. Beyond that I only know the UE4 has poo poo for good database options.

I thought iOS had it by default and most but not all android manufacturers have it, so in practice you need to bundle it yourself on android or fail to support some number of devices/manufacturers.

Sedgr
Sep 16, 2007

Neat!

I've heard good things about Unity+Fungus for those types of things but not used it myself.

M2tt
Dec 23, 2000
Forum Veteran

leper khan posted:

I thought iOS had it by default and most but not all android manufacturers have it, so in practice you need to bundle it yourself on android or fail to support some number of devices/manufacturers.

Not sure where you got that idea, I mean you do need define your own db on the file system, if that's what you're talking about? Beyond that it's just an include statement....does that count as bundling it myself? No doubt there are manufacturers that have done a poor job in the past but that sounds an awful lot like a dead horse to me.

As for iOS I can only speak to what I know. Which I don't.

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

M2tt posted:

Not sure where you got that idea, I mean you do need define your own db on the file system, if that's what you're talking about? Beyond that it's just an include statement....does that count as bundling it myself? No doubt there are manufacturers that have done a poor job in the past but that sounds an awful lot like a dead horse to me.

As for iOS I can only speak to what I know. Which I don't.

No, I mean nonsense like this. Maybe android has become less nonsense in the past couple years, but I somehow expect it’s just as it ever was.

https://answers.unity.com/questions/678131/sqlite3dll-not-found-on-specific-android-devices.html

M2tt
Dec 23, 2000
Forum Veteran

leper khan posted:

No, I mean nonsense like this. Maybe android has become less nonsense in the past couple years, but I somehow expect it’s just as it ever was.

https://answers.unity.com/questions/678131/sqlite3dll-not-found-on-specific-android-devices.html

Reads to me like a Unity issue from 5 years ago. :shrug:

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!
Has anybody here toyed around with saving and loading state that is tied up halfway into some coroutines in Unity?

Ruzihm
Aug 11, 2010

Group up and push mid, proletariat!


Rocko Bonaparte posted:

Has anybody here toyed around with saving and loading state that is tied up halfway into some coroutines in Unity?

No and that sounds pretty rough! :stare:

FuzzySlippers
Feb 6, 2009

Reposting this here:

Is it possible to kill Boo completely and make sure it never comes back to any VS intellisense poo poo ever again? I got rid of Resharper lately because it was just grinding my big rear end Unity project to a halt, but now I can't stop intellisense constantly wanting to insert Boo poo poo into my files (thank you Boo List<T>). Apparently Resharper was doing something to prevent it before.

This may seem minor but it's driving me crazy and I might switch to Rider. Rider has a bunch of its own quirks but maybe I can get used to them (like doesn't the font rendering look slightly weird to anyone?).

chglcu
May 17, 2007

I'm so bored with the USA.
I’ve switched to rider recently, and yeah the font rendering is different from VS, but it doesn’t look bad to me. Having the source for packages included in the project and the built in resharper functionality has so far outweighed any issues I’ve run into, though the start up time is kinda obscene.

edit: As for your initial question, I’ve literally never had any Boo stuff show up with or without resharper. Do you maybe have an ancient version of the Unity VS tools extension installed, or maybe even something specifically for Boo?

chglcu fucked around with this message at 09:19 on Sep 9, 2019

Boz0r
Sep 7, 2006
The Rocketship in action.
I use Visual Studio at work and Rider at home. Visual Studio is crap compared to Rider, IMHO, if you don't need all the connections to every other Microsoft product.

Boz0r
Sep 7, 2006
The Rocketship in action.
I've run into a problem with my rts game in Unity that seems really simple, but I can't really think of a good solution for it. I've got a worker unit and an unbuilt building. I want the worker to move to the building, but if I set the destination to the building's position he walks around it trying to get as close as possible to the position instead of just moving adjacent to it. I'm using Unit's navmesh. Should I continually find the optimal destination or something?

Nolgthorn
Jan 30, 2001

The pendulum of the mind alternates between sense and nonsense
Maybe add a collision mesh to the building and detect when the unit runs into it.

Boz0r
Sep 7, 2006
The Rocketship in action.

Nolgthorn posted:

Maybe add a collision mesh to the building and detect when the unit runs into it.

I don't think that'll work, cause if the point closest to the building's center has a weird detour the worker will walk that way before hitting that mesh

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
Can you treat the building itself as pathable (but only for the unit that's trying to build it)? That way they'll take the shortest path to the center instead of going around the outside, and you can detect when they reach the edge in order to stop them and switch from movement to building.

Adbot
ADBOT LOVES YOU

FuzzySlippers
Feb 6, 2009

chglcu posted:

I’ve switched to rider recently, and yeah the font rendering is different from VS, but it doesn’t look bad to me. Having the source for packages included in the project and the built in resharper functionality has so far outweighed any issues I’ve run into, though the start up time is kinda obscene.

edit: As for your initial question, I’ve literally never had any Boo stuff show up with or without resharper. Do you maybe have an ancient version of the Unity VS tools extension installed, or maybe even something specifically for Boo?

I definitely haven't installed any Boo related stuff and I'm running the newest Unity tools. I couldn't find any Boo related settings. I had thought Unity removed Boo/Unityscript but it seems like they've just hidden them for legacy reasons and my copy of VS is bent on dragging it out. I've been running VS+Resharper so long I don't remember how it was previously, but whatever settings are in VS now is it obsessed with Boo. Rather than unfuck visual studio I'll just try out Rider for a while.

The text on Rider just looks slightly off. Like the font is bolder than it should be and yet also squished. It's subtle but just kinda bugs me. I'm sure I'll get used to it eventually.

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