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
Adhemar
Jan 21, 2004

Kellner, da ist ein scheussliches Biest in meiner Suppe.

Subjunctive posted:

XML is for when someone forced you at gunpoint to use XML.

Don't protobufs and cap'n proto have optional human-readable encodings?

Agreed on the XML point, I just mentioned for completeness because it's still widely used. Not sure about the human readable encoding thing, that would defeat the performance gain, although at least Protobuf allows you to easily transform any (binary) protocol buffers into a human readable representation for debugging/logging purposes. I'm sure the others do something similar but I haven't used them personally. Yet. SBE looks super sexy and I'm looking for an excuse to take it for a spin. In-place zero-copy deserialization, baby.

Adbot
ADBOT LOVES YOU

Centripetal Horse
Nov 22, 2009

Fuck money, get GBS

This could have bought you a half a tank of gas, lmfao -
Love, gromdul

Ranzear posted:

I've set it up to be more fun with a ton of people, sniping each other from the fog and whatnot, but even mano a mano is pretty interesting.

Are you familiar with Subspace/Continuum? It was/is the best free online space shooter of all time. It had an enormous community for years, and years. To this day, there are one or two active servers, which is impressive given that the game came out nearly 20 years ago. I ask because your game looks like what I imagine an early alpha of Subspace might have been. It would be super cool to see something like Continuum make its way into the world of browser-based games.

xzzy
Mar 5, 2009

Json is nice because parsing it is so easy.

XML.. not so much. It is "better" in the way it structures data but it gets horribly misused basically everywhere so it makes it kind of hard to see.

ErIog
Jul 11, 2001

:nsacloud:

xzzy posted:

Json is nice because parsing it is so easy.

XML.. not so much. It is "better" in the way it structures data but it gets horribly misused basically everywhere so it makes it kind of hard to see.

One of the reasons JSON is easier to deal with than XML is that JSON looks a bit less familiar to people than XML. So people don't try to write fake JSON by hand, parse it by regex, and then claim they're using JSON like people often do with XML.

Ranzear
Jul 25, 2013

Centripetal Horse posted:

Are you familiar with Subspace/Continuum? It was/is the best free online space shooter of all time. It had an enormous community for years, and years. To this day, there are one or two active servers, which is impressive given that the game came out nearly 20 years ago. I ask because your game looks like what I imagine an early alpha of Subspace might have been. It would be super cool to see something like Continuum make its way into the world of browser-based games.

gently caress me sideways! That's what it was called!

I played that a long time ago, but it kinda got replaced in my head later on by uhhh ... that other SoE game* on the same engine as Infantry, and I was never able to remember what the prior was. (Aside: Toutat.us will someday be my Tanarus successor.)

But really, most of BeamDuel came from having a Gravitar cabinet in the living room.

Speaking of games from 1997, I'd never heard of Tibia (practically a UO clone), but apparently it's still around too and there's even private server developments. Some guy was streaming it over the weekend. Lots of very pure RPG mechanics in the midst of very pure 1990s interface clunk. They were working on a boss that required you turn his own pets back on him to kill him to match the official version..

Edit:
* Cosmic Rift

Ranzear fucked around with this message at 07:10 on Feb 25, 2015

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!

Jo posted:

You can probably make an animation state with a blend-tree as a sub-node. See this: https://www.youtube.com/watch?v=HeHvlEYpRbM

The different is, instead of blending based on 'direction' or something, you can probably generate a random number each time so it will blend randomly between your idles.

Apparently this is the party line on how to do it actually, but I can't really get anything out of it. My problem is figuring out how to alternate between the states. They have different lengths. I was hoping to set up animation events, but I can't figure out how to make the animations editable so I can insert the events. It doesn't help that I've never done this all before. What is the trick to ungraying the animation in the inspector in a blend tree so I can insert animation events at the end of each idle animation?

Edit: More fun and games with animation. I earlier posted how to normalize an animation where the center of mass was moving during it. It was an animation of a zombie trying to crawl into a window. I managed to figure out how to do that, but there were consequences. The zombie falls inside the house and rolls onto its back. When it hits the ground, it actually ends up disappearing through the floor. Somehow, it's winding up at a height lower than the feet are when I start, and lower than any bones were set in the original animation. As it starts to get back up, it starts to adjust again. What could be going wrong?

Edit Edit: I'd be interested if there was a comprehensive guide that goes into all these trials and tribulations, or even a YouTube video. The basic documentation is good so long as what I'm doing is consistent with what they're showing, which isn't that much.

Rocko Bonaparte fucked around with this message at 07:29 on Feb 25, 2015

TheresaJayne
Jul 1, 2011

Ranzear posted:

gently caress me sideways! That's what it was called!

I played that a long time ago, but it kinda got replaced in my head later on by uhhh ... that other SoE game* on the same engine as Infantry, and I was never able to remember what the prior was. (Aside: Toutat.us will someday be my Tanarus successor.)

But really, most of BeamDuel came from having a Gravitar cabinet in the living room.

Speaking of games from 1997, I'd never heard of Tibia (practically a UO clone), but apparently it's still around too and there's even private server developments. Some guy was streaming it over the weekend. Lots of very pure RPG mechanics in the midst of very pure 1990s interface clunk. They were working on a boss that required you turn his own pets back on him to kill him to match the official version..

Edit:
* Cosmic Rift

Talking of old games, the one i miss the most - Midi Maze on the Atari ST fm
I loved going down our local compucade and playing in the league they had there.

Now a multiplayer better GFX version of that would be amazing....
https://www.youtube.com/watch?v=8hSoy1S43dw

Ranzear
Jul 25, 2013

I'm thinking to turn BeamDuel into a multiplayer Gravitar sort of thing. Couple of planets, dynamic zoom-in and rotation to ground tangent when you approach one. Regenerating energy consumes fuel which you pick up from planets.

I'm still getting used to top-left origin and left-handed rotation though. Has really thrown me on what should be a lot of simple math that I should have learned well enough from messing with SuperTanks.

OneEightHundred
Feb 28, 2008

Soon, we will be unstoppable!

xzzy posted:

Json is nice because parsing it is so easy.

XML.. not so much. It is "better" in the way it structures data but it gets horribly misused basically everywhere so it makes it kind of hard to see.
I don't think it's even better in the way it structures data. JSON has some type annotation built in to the format (i.e. numbers are distinct from strings, arrays are their own format), JSON attributes can contain nodes, CDATA is a giant hack, indentation/line breaks in XML are considered data (whitespace text nodes), which complicates parsing.

e: I can think of a new bad thing about XML every 5 minutes. It's a markup format, use it when you need to mark up text or structure a document containing primarily text, for anything else don't.

OneEightHundred fucked around with this message at 15:13 on Feb 25, 2015

Obsurveyor
Jan 10, 2003

XML is the most verbose trash ever with a 2:1 markup to data ratio(or higher) in most cases. Users don't understand how to read it, can't write it for poo poo and no one can agree on any of it. If a DTD is ever actually written for it(bahahahaha), it's either schizophrenic as gently caress or takes until the heat death of the universe to get right.

Rocko Bonaparte posted:

Apparently this is the party line on how to do it actually, but I can't really get anything out of it. My problem is figuring out how to alternate between the states. They have different lengths. I was hoping to set up animation events, but I can't figure out how to make the animations editable so I can insert the events. It doesn't help that I've never done this all before. What is the trick to ungraying the animation in the inspector in a blend tree so I can insert animation events at the end of each idle animation?

Mecanim doesn't support animation events, you have to use a third party solution from the asset store.

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.'
After nearly a year of dealing with RESTful APIs, all I can say is, thank god they don't use XML.

xzzy
Mar 5, 2009

ErIog posted:

One of the reasons JSON is easier to deal with than XML is that JSON looks a bit less familiar to people than XML. So people don't try to write fake JSON by hand, parse it by regex, and then claim they're using JSON like people often do with XML.

There was an in-house project where some genius decided to implement scripting with xml. There would be something like an <if> tag, and within it there'd be a tag for the conditional and instructions for true/false.

The parser turned it into python code that eventually got fed into an exec(). :downs:

OneEightHundred
Feb 28, 2008

Soon, we will be unstoppable!

xzzy posted:

There was an in-house project where some genius decided to implement scripting with xml. There would be something like an <if> tag, and within it there'd be a tag for the conditional and instructions for true/false.

The parser turned it into python code that eventually got fed into an exec(). :downs:
Could be worse, he could have implemented it in XSLT.

KaneTW
Dec 2, 2011

XML as a format is terrible. It's not efficient in any way, shape or form and to top it off it's only a tiny bit more human-readable than binary data formats. Use protobuf or JSON.

Polio Vax Scene
Apr 5, 2009



dupersaurus posted:

After nearly a year of dealing with RESTful APIs, all I can say is, thank god they don't use XML.

As a software dev by day let me tell you about the horrors I have seen.

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.'

Manslaughter posted:

As a software dev by day let me tell you about the horrors I have seen.

Oh, that was my day job. I wouldn't subject myself to such horrors as a hobby.

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.

Manslaughter posted:

As a software dev by day let me tell you about the horrors I have seen.
We got a thread for you: http://forums.somethingawful.com/showthread.php?threadid=2803713

xzzy
Mar 5, 2009


Hmm, 28,000 posts. See everyone in a month, because coding horrors are like a black hole for me. I just can't stop reading them.

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!

xzzy posted:

There was an in-house project where some genius decided to implement scripting with xml. There would be something like an <if> tag, and within it there'd be a tag for the conditional and instructions for true/false.

The parser turned it into python code that eventually got fed into an exec(). :downs:

I could complain about this, but I've found this isn't really XML-specific. Inevitably, somebody will try to turn a data format into a programming language. I kept having to add extensions to some test data format I had defined at work a few years back, and I got right to the precipice's edge. It's usually incremental, and takes a wake-up call to realize it's time to integrate with a programming language.

You can usually smell it coming when somebody asks for some kind of meta thing in the file format you're using. Like, "I want this to happen when this, but not that. We could add a notation above the normal format to support it."

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!
And back to our regularly-scheduled game development stuff:

Obsurveyor posted:

Mecanim doesn't support animation events, you have to use a third party solution from the asset store.
I am going to be the asker of rhetorical questions. Does Unity's animation system kind of ... stink? I really haven't used engines much, but it's striking me as odd. At least now all the coroutines I've seen online to time transitions make sense. Even the little engine I made ~5 years ago supported embedding events. :(

So, what are the grown-ups doing for animation? "Use UE4" is not the answer this time, please.

Jo
Jan 24, 2005

:allears:
Soiled Meat

Rocko Bonaparte posted:

Even the little engine I made ~5 years ago supported embedding events. :(

I thought it was possible to embed events in animations? I remember using triggers for a now defunct FPS that called a hit test at a certain point. Am I misunderstanding?

poemdexter
Feb 18, 2005

Hooray Indie Games!

College Slice
I've had no trouble using animation events in mecanim to do some pretty intense state management for a side scrolling beatemup prototype. No problems here.

FuzzySlippers
Feb 6, 2009

Obsurveyor posted:

Mecanim doesn't support animation events, you have to use a third party solution from the asset store.

Mecanim has supported events for quite a while. Like a year? You stick them in the timeline just like animation curves which can also be used for events.

Mind you, events in Mecanim can fail to fire due to blending which is dumb. I think they also fire off the event using something like SendMessage which might have performance issues if you have a billion scripts on your gameobject.

Mecanim was terrible in 4.0 but now in 5 its pretty usable. It still has some obnoxious UI decisions and it has some dumb scripting limitations but its still very usable. Proper commercial games like PoE use it.

FuzzySlippers fucked around with this message at 19:13 on Feb 25, 2015

Obsurveyor
Jan 10, 2003

Are there two types of animation events in Unity? As far as I have ever found, you can't edit the animations that Mecanim takes in Unity's Animation window to assign the events because the object has to have an Animation component, which isn't what Mecanim uses.

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!
I was going by Obsurveyor's response that it wasn't supported. Is there a new thing instead?

I made a Blend Tree to alternately play different idle animations in a sequence. My problem is figuring out when the play the next idle animation. I figured I could set an event to trigger on that, but all the animations come up grayed out in the inspector. I can't figure out how to insert an event at the end of the animation. So the best I can imagine is something with a coroutine that monitors if it's still playing an idle animation, and when it isn't, poke it to play a new one.

FuzzySlippers
Feb 6, 2009

Obsurveyor posted:

Are there two types of animation events in Unity? As far as I have ever found, you can't edit the animations that Mecanim takes in Unity's Animation window to assign the events because the object has to have an Animation component, which isn't what Mecanim uses.

It sounds like you are using the legacy animation window which won't work. You add them directly to the clip like an animation curve.

If you are using Mixamo animations I've heard they do something dodgy with how they give the animations that makes it impossible to add curves or events (or at least it was so a few versions ago).

FuzzySlippers fucked around with this message at 19:23 on Feb 25, 2015

FuzzySlippers
Feb 6, 2009

Rocko Bonaparte posted:

I was going by Obsurveyor's response that it wasn't supported. Is there a new thing instead?

I made a Blend Tree to alternately play different idle animations in a sequence. My problem is figuring out when the play the next idle animation. I figured I could set an event to trigger on that, but all the animations come up grayed out in the inspector. I can't figure out how to insert an event at the end of the animation. So the best I can imagine is something with a coroutine that monitors if it's still playing an idle animation, and when it isn't, poke it to play a new one.

There's probably a huge pain in the rear end way of accomplishing this with events but I'd just have a script grab the AnimatorStateInfo to determine when your clip is finished playing and then have it change the blend tree value. The clips can all loop and you don't need to start playing just change the value.

Inverness
Feb 4, 2009

Fully configurable personal assistant.
I haven't seen anyone mention YAML.

There is a modern C# library for that too: https://github.com/xoofx/SharpYaml/

Pollyanna
Mar 5, 2005

Milk's on them.


^^^ YAML sounds like a great tool for data-driven development, especially for the Prototype pattern.

So I've decided to start some game-dev exercises using a framework called Gosu, for Ruby. I've just pushed an MVP for my input test exercise: https://github.com/rpazyaquian/input-test

I'd like comments and refactoring advice on this and any other exercises I do! It helps a lot to see people's changes in action. In particular, I have a question about this exercise: I managed to write a working input, but what happens when I want to reuse this in another exercise? I have to copy all the code from input-test, and that's a pain...is there a way to split it out into its own thing, like a library of some sort?

(If this seems naive, that's intentional. I overcomplicate things by trying to go for clever solutions right off the bat. Why not help me improve it? :3: )

xgalaxy
Jan 27, 2004
i write code

Inverness posted:

I haven't seen anyone mention YAML.

There is a modern C# library for that too: https://github.com/xoofx/SharpYaml/

Unity3d uses yaml for its text based representations of the scene, game objects, etc.
I'm not really a fan myself - its harder to read and make sense of in my opinion.

Obsurveyor
Jan 10, 2003

JSON is a subset of YAML if you wanna be super pedantic about it. :) Real easy to migrate up if you need to.

Lork
Oct 15, 2007
Sticks to clorf

Rocko Bonaparte posted:

I was going by Obsurveyor's response that it wasn't supported. Is there a new thing instead?

I made a Blend Tree to alternately play different idle animations in a sequence. My problem is figuring out when the play the next idle animation. I figured I could set an event to trigger on that, but all the animations come up grayed out in the inspector. I can't figure out how to insert an event at the end of the animation. So the best I can imagine is something with a coroutine that monitors if it's still playing an idle animation, and when it isn't, poke it to play a new one.
Are you clicking on the animation clips themselves? If so, you need to go one level up the tree and edit the import settings.

Shalinor
Jun 10, 2002

Can I buy you a rootbeer?

poemdexter posted:

I've had no trouble using animation events in mecanim to do some pretty intense state management for a side scrolling beatemup prototype. No problems here.
If you're dealing with Unity 4.X, this is kinda dangerous - it can and will skip animation events near the beginning or end of animations. So long as you're able to build your animations such that none of your events hit in those windows, you'll be fine, but - definitely be aware. Supposedly that bug is fixed in 5.X beta, though.

poemdexter
Feb 18, 2005

Hooray Indie Games!

College Slice

Shalinor posted:

If you're dealing with Unity 4.X, this is kinda dangerous - it can and will skip animation events near the beginning or end of animations. So long as you're able to build your animations such that none of your events hit in those windows, you'll be fine, but - definitely be aware. Supposedly that bug is fixed in 5.X beta, though.

That was always the caveat. I always put my animation events 1 frame before the end of an animation to guarantee they'd fire.

Ranzear
Jul 25, 2013

Ah YAML ... I forgot about that one.

Probably for good reason.


I figured out why BeamDuel still has little inconsistencies: While it's using delta-time, some events like firing are still just happening on tick because it's simulating past their trigger point and resolving them on the next update. This means the server will simulate turning for the whole tick before finishing the firing cycle immediately on the next pass. This isn't too much to do with 'we're at full charge, fire the beam on the next frame', because it also means player movements aren't being simulated in proper step with the firing cycle

I now have to implement what I'd call 'delta splitting'. Maybe someone will have a more standard name for it. It would happen on both server and client.

Pre-pass all objects for events like spawning a bullet or otherwise resetting a cooldown, and turn the delta step into two delta steps split on it. On each split, update the object that caused the split first. This also means that any new objects are added and simulated on proper time instead of the next whole frame or step. This shouldn't get too crazy but I can also keep a minimum delta time of 6ms (because 144hz support) by combining closer splits, with the interesting implication that any events within 6ms of each other are considered simultaneous. With the current 24ms updates it should only cram three extra passes in at worst. This should also help beautifully on the client side when lag correction is added to the delta time.

If I'd gotten to spawning bullets before working this out they would have been wildly inconsistent because they would be created 'late' on the server every single time because of the relatively low update rate (42/sec vs 60/120/144). Maybe some of this stems from my server update step being tied to the network rate, but I later want to be able to step both up or down within a single instance depending on PvE and PvP scenario, and with multiple instances on the same server I don't really want or need it running simulation any faster than network updates.

[/livejournal]

Ranzear fucked around with this message at 23:47 on Feb 25, 2015

ModeSix
Mar 14, 2009

Obsurveyor posted:

Just look up "C# XML serialization". There's nothing special about Unity and XML unless you're looking to serialize Unity objects to XML and even then, it's probably easier to start with regular C# object serialization and then figure out the Unity gotchas, if any.

My personal opinion: You should use JSON(see Json.NET) instead of XML.

Thanks for introducing me to JSON, it seems like it will do exactly what I want it to.

I'm a very amateur game programmer, basically learning as I go, so a lot of the tricks and niceties about better/different/more efficient way to do things is all new to me. I really wish I had taken programming in college instead of network administration. (15 years ago).

My first introduction to game programming was actually about 4 years ago in Xcode learning how to use Cocos2D. I'm not sure if I prefer Cocos2D/Xcode or Unity to be honest. I find Unity does some really nice things, like having a visual editor to position elements on screen, but I rather enjoyed the class based approach that Xcode has. Needless to say I've published something with Unity, did not publish a drat thing with Xcode/Cocos2D.

Unormal posted:

XML is sometimes also useful for when you need schema validation or structured queries and transforms. This doesn't happen that much in game dev.

XML is also way more readable to designers than JSON is. JSON is readable to developers, but not to designers, because lots of designers have worked with HTML at least a little, but JSON is more out there.

I use SimpleJSON a lot, because I can just paste that one file into a project where I need some json parsing, and I'm off to the races with minimum fuss.

http://wiki.unity3d.com/index.php/SimpleJSON

Thanks for this, it looks like it will be really helpful in my quest to implement JSON into Unity in a way that I can figure it out.

ModeSix fucked around with this message at 02:21 on Feb 26, 2015

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!

Lork posted:

Are you clicking on the animation clips themselves? If so, you need to go one level up the tree and edit the import settings.

Oh I managed to bumble into it. Okay now I can start to toy with this! =D

Edit: What I did was in the assets is I selected the actual imported model, not the dogpile of imported animations it placed in the same folder after import. I selected one of the animations in the inspector, and then scrolled all the way down in the view. Boom. Events.

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!
I have more AnimationEvent nonsense. I have a component to which I added a public void AnimationDone(int stuff) method to receive the event. When I add the event, I write in the function name field "AnimationDone." I set the int parameter to 1. Everything else is untouched. The event does trigger and my callback receiver does run, but then I get these errors afterwards:

'GameObject' AnimationEvent 'AnimationDone' has no receiver! Are you missing a component?
'zombie_unmirrored' AnimationEvent 'AnimationDone' has no receiver! Are you missing a component?

I should note that zombie_unmirrored is the imported name of my model. It seems like it's just spraying that event all around. What do I do?

Update: The problem was that I had little dingleberry objects in the scene that didn't have that component attached to it. I got rid of them and poo poo those errors right up.

Rocko Bonaparte fucked around with this message at 17:22 on Feb 26, 2015

retro sexual
Mar 14, 2005
What is everyone using to deal with resolution switching for your fullscreen game? We have the game and UI working for several different resolutions and aspect ratios already, but we have to specify which one to use at compile time (it's packaged with adobe AIR).

We need it to be switchable at launch. Any ideas?

Adbot
ADBOT LOVES YOU

evilentity
Jun 25, 2010
I dunno, json i use for my data is fairly readable. I would probably get an aneurysm if i had to write a million tags by hand. Its not like i have to write a parser for that myself :shrug:
code:
{
command: [
{
    name: base-order
    abstract: true
    selection-priority: 25
    on-grid: true
    dimensions: {
        depth:0.0
        z-offset:5
    }
},{
    name: cancel-order
    parent: base-order
    overlay: entities/objects/cancel
    on-grid: false
    order: {
        type: cancel
        target-tags: cancelable
    }
}]}

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