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
ahmeni
May 1, 2005

It's one continuous form where hardware and software function in perfect unison, creating a new generation of iPhone that's better by any measure.
Grimey Drawer

poemdexter posted:

2dtoolkit is worth the purchase because I can do stuff like this.

Why is vomiting blood so satisfying?

Adbot
ADBOT LOVES YOU

Mug
Apr 26, 2005
Hahaha took me ages to notice the poo poo pouring out too.

poemdexter
Feb 18, 2005

Hooray Indie Games!

College Slice

ahmeni posted:

Why is vomiting blood so satisfying?

I have no idea. I just wanted a simple slit throat particle effect and got it done last week. Then I got networking working and a buddy said "just move it down and make it yellow..." and then it all went downhill from there.

Shalinor
Jun 10, 2002

Can I buy you a rootbeer?
On the uGUI stuff, did they fix the nGUI issue of requiring you to use a third party bitmap font renderer? Can it go straight from a TTF?

I feel horrible for all those PC-only devs that have to suffer through BMFont. It is almost impossible to get a good looking bitmap got out of it.

stramit
Dec 9, 2004
Ask me about making games instead of gains.

Shalinor posted:

On the uGUI stuff, did they fix the nGUI issue of requiring you to use a third party bitmap font renderer? Can it go straight from a TTF?

I feel horrible for all those PC-only devs that have to suffer through BMFont. It is almost impossible to get a good looking bitmap got out of it.

It goes straight through ttf, and holy poo poo that is 3 weeks of my life I want to get back.

Zizi
Jan 7, 2010

Shalinor posted:

On the uGUI stuff, did they fix the nGUI issue of requiring you to use a third party bitmap font renderer? Can it go straight from a TTF?

I feel horrible for all those PC-only devs that have to suffer through BMFont. It is almost impossible to get a good looking bitmap got out of it.

NGUI already support dynamic fonts in lieu of bitmap fonts-- I'm doing that right now, in fact.

Seven Force
Nov 9, 2005

WARNING!

BOSS IS APPROACHING!!!

SEVEN FORCE

--ACTIONS--

SHITPOSTING

LOVE LOVE DANCING

I'm just now learning C++ after a few years of using Game Maker, it looks like there's not much different so I'm feeling pretty good so far. :) I'd like to try and make some simple 2D sprite games. Is Dev C++ and Allegro good or should I get OpenGL? Or something else entirely? :ohdear:

Paniolo
Oct 9, 2007

Heads will roll.

Seven Force posted:

I'm just now learning C++ after a few years of using Game Maker, it looks like there's not much different so I'm feeling pretty good so far. :)

Famous last words.

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.
^^^^ At least working with GML must've made him battle-hardened by now.

Seven Force posted:

I'm just now learning C++ after a few years of using Game Maker, it looks like there's not much different so I'm feeling pretty good so far. :) I'd like to try and make some simple 2D sprite games. Is Dev C++ and Allegro good or should I get OpenGL? Or something else entirely? :ohdear:
If you're just starting out I wouldn't recommend jumping into something like OpenGL straight away, specially if you're just making simple 2D sprite games.

AFAIK, the popular C/C++ game libraries are SDL and SFML. I've heard of Allegro too but don't really know much about it. They all offer similar functionality though so I'd suggest just looking through tutorials and documentation, seeing which one you get along with best and picking that.

SupSuper fucked around with this message at 03:40 on Aug 31, 2013

Seven Force
Nov 9, 2005

WARNING!

BOSS IS APPROACHING!!!

SEVEN FORCE

--ACTIONS--

SHITPOSTING

LOVE LOVE DANCING

Thanks for pointing me in the right direction. I'll definitely check out SFML. I've been coding on and off in GML and so far it doesn't seem too difficult. I'm sure I'll be proven wrong soon!

Polio Vax Scene
Apr 5, 2009



Seconding SFML, it is really good, it reminds me a lot of Game Maker.

xgalaxy
Jan 27, 2004
i write code
On the topic of Unity. The company I work for is going to be using it and everyone on the project, including myself have very little to no Unity experience.
I was curious if there are well regarded open source code snippits, helper scripts, etc. out there? Editor extensions, general quality of life type stuff?

I thought I remembered seeing some sort of Wiki or something with a bunch of Unity code snippits for editor extensions and such.

Papercut
Aug 24, 2005
The "Community" link on the Unity website has what you're looking for, including a link to a Wiki that has tons of code samples and useful scripts/plug-ins/shaders/etc, as well as tutorials.

FateFree
Nov 14, 2003

I've been working with using an entity system (Artemis) to build a game, and I had a question about the architecture. I have no problem with simple, disjointed entities - things like trees on a map, or an animated sprite. I have standard position, velocity, sprite components and movement, animation systems etc.

The problems start when these components need to interact with each other. For example, I have a sprite who I'd like to identify the nearest tree in a grid, walk over to it, and then remove it.

How would something like this translate in an entity system? It seems I need a system that works on a sprite (or lets say a Worker component), but that also pulls in every tree, finds the closest one, and updates its velocity to move towards it? I guess the confusing thing is how to pull all of these entities into a single system, given the way Artemis defines Aspects. I'd appreciate any insight.

Problem Sleuth
Apr 12, 2011

WELCOME TO THE NEW FUTURE
Does anyone have any good suggestions for articles/tutorials on how to get into very simple multiplayer game-making? I know I can use Unity, but I'd prefer something that can function in two dimensions more easily.

Unfortunately, I know next to nothing about this topic, so beginner resources would be appreciated!

OtspIII
Sep 22, 2002

Problem Sleuth posted:

very simple multiplayer

I think these words might be mutually exclusive. :(

I'm very interested in learning how to handle networking, myself, though.

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!

OtspIII posted:

I think these words might be mutually exclusive. :(
You can do very simple shared screen multiplayer. Or turn-based. Or to some extent it's still simple with lovely laggy controls where nothing happens until the message has been to the server and back.

Once you get to trying to make it so the players don't experience horrible control lag though, it is not simple.

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

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

:allears:

Shalinor posted:

I feel horrible for all those PC-only devs that have to suffer through BMFont. It is almost impossible to get a good looking bitmap got out of it.

Jeeeeeeesus, I'm trying to get something that doesn't look like rear end out of it right now and it isn't working. Any tips?

Edit: the only things that seem to remotely help are to not use any of the smoothing options and stick to black text :smithicide:. And bold.

ZombieApostate fucked around with this message at 20:43 on Sep 2, 2013

OneEightHundred
Feb 28, 2008

Soon, we will be unstoppable!

Problem Sleuth posted:

Does anyone have any good suggestions for articles/tutorials on how to get into very simple multiplayer game-making? I know I can use Unity, but I'd prefer something that can function in two dimensions more easily.

Unfortunately, I know next to nothing about this topic, so beginner resources would be appreciated!
Basic multiplayer is conceptually pretty simple, most of the tricks are in mitigating the effects of lag to be less annoying to players.

At the backend, normally you want either UDP or TCP for messaging. TCP just pumps a stream of bytes through that are guaranteed to arrive complete and in order, but it doesn't handle net quality issues elegantly. UDP lets you send packets that will be completely received if they're received, but packets can be lost or arrive out of order. The tradeoff is that if a network hiccup occurs, UDP will still give you more packets, while TCP will stop everything until it can ask the other end to send the packet it's missing.

Below that, there are two basic models of multiplayer: Peer-to-peer and client-server.

Peer-to-peer needs a deterministic simulation (meaning that every game step, all players will have the input of all players for that step and will run it, getting exactly the same results). The main advantage of it is that it's very light on bandwidth even when there's a lot of stuff going on in the world, so it's pretty common in RTS games. The main drawback is that the game is as laggy as the laggiest player, because all players need to be fully synced up for a world step.

Client-server mostly has each player act as a dumb rendering and input terminal while the server decides what's going on in the world, so clients will generally push updates about their input state and the server will push updates about the world and player states.

Most of the complexity is in prediction, which is necessary in fast-paced games because players want to see a lot of things happen as soon as they supply input for it even if it winds up not actually happening (i.e. firing weapons). I can run down some of the approaches for that if you want.

Shalinor posted:

I feel horrible for all those PC-only devs that have to suffer through BMFont. It is almost impossible to get a good looking bitmap got out of it.
You're not using bitmap fonts rendered with a different point size than the one you're displaying at, are you? That's a really common mistake when rendering fonts and something you should never do, if you want fonts at multiple point sizes then you need to render them at each point size, not just take a big one and scale it down.

OneEightHundred fucked around with this message at 20:58 on Sep 2, 2013

Yodzilla
Apr 29, 2005

Now who looks even dumber?

Beef Witch
It's not just that, the kerning and, well, just about everything else that comes out of BMFont is just plain ugly if you can get it to work at all. I've never had a font fail out of Glyph Designer but for some reason BMFont occasionally just shits itself and spits out unusable garbage.

OneEightHundred
Feb 28, 2008

Soon, we will be unstoppable!
Maybe I'll slap together an alternative next weekend or something then because cranking a font through FreeType and a bin packer isn't rocket science.

No promises on exporting RTL, overlap, or ligatures though.

OneEightHundred fucked around with this message at 23:38 on Sep 2, 2013

poemdexter
Feb 18, 2005

Hooray Indie Games!

College Slice

FateFree posted:

I've been working with using an entity system (Artemis) to build a game, and I had a question about the architecture. I have no problem with simple, disjointed entities - things like trees on a map, or an animated sprite. I have standard position, velocity, sprite components and movement, animation systems etc.

The problems start when these components need to interact with each other. For example, I have a sprite who I'd like to identify the nearest tree in a grid, walk over to it, and then remove it.

How would something like this translate in an entity system? It seems I need a system that works on a sprite (or lets say a Worker component), but that also pulls in every tree, finds the closest one, and updates its velocity to move towards it? I guess the confusing thing is how to pull all of these entities into a single system, given the way Artemis defines Aspects. I'd appreciate any insight.

I don't know how Artemis does it, but when I was doing entity/component with XNA, I had manager classes that would manage groups of things. For your example, I would probably have some TreeManager class that has a list of all trees in it. Then on my sprite, I'd have some action that would call TreeManager.findNearestTree(myPosition). That would return the tree you need and you can do the rest.

Problem Sleuth posted:

Does anyone have any good suggestions for articles/tutorials on how to get into very simple multiplayer game-making? I know I can use Unity, but I'd prefer something that can function in two dimensions more easily.

Unfortunately, I know next to nothing about this topic, so beginner resources would be appreciated!

If you're doing Unity, you might have trouble wrapping your head around the fact that you're writing a single script that handles both your action and your client's action for just about everything. If you have trouble keeping the flow in your head, it's easy to get lost.

"Very Simple" is not really a good way to describe net code at all, but if you're looking for a barebones example in unity, here's my game jam entry (uses 2dtoolkit for sprites): https://github.com/poemdexter/2DToolkit-Game

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

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

:allears:

OneEightHundred posted:

You're not using bitmap fonts rendered with a different point size than the one you're displaying at, are you? That's a really common mistake when rendering fonts and something you should never do, if you want fonts at multiple point sizes then you need to render them at each point size, not just take a big one and scale it down.

I've tried displaying them without resizing them. It actually looks slightly better when I scale it down. The characters just have rough edges and weird dark halos. If I take the tga I get from BMFont, open it in Paint.NET or whatever and throw a white layer underneath the original layer, you can see a bunch of dark outlines around the characters. I assume they're there to attempt to make the diagonals/curves have sharper edges, but they just end up looking bad.

I'm using UIToolkit (I'm too poor for NGUI :saddowns:), which has you run the tga/png through TexturePacker before you can access it in Unity. I'm not sure whether TexturePacker might be doing anything that could mess it up, but I would assume not. The tga/png doesn't look all that sharp before I put it through TexturePacker anyway.

OneEightHundred posted:

Maybe I'll slap together an alternative next weekend or something then because cranking a font through FreeType and a bin packer isn't rocket science.

No promises on exporting RTL, overlap, or ligatures though.

If you happen to dump a fnt file in the same format as BMFont (or a subset of it), I will love you.

HiriseSoftware
Dec 3, 2004

Two tips for the wise:
1. Buy an AK-97 assault rifle.
2. If there's someone hanging around your neighborhood you don't know, shoot him.

ZombieApostate posted:

I've tried displaying them without resizing them. It actually looks slightly better when I scale it down. The characters just have rough edges and weird dark halos. If I take the tga I get from BMFont, open it in Paint.NET or whatever and throw a white layer underneath the original layer, you can see a bunch of dark outlines around the characters. I assume they're there to attempt to make the diagonals/curves have sharper edges, but they just end up looking bad.

I'm using UIToolkit (I'm too poor for NGUI :saddowns:), which has you run the tga/png through TexturePacker before you can access it in Unity. I'm not sure whether TexturePacker might be doing anything that could mess it up, but I would assume not. The tga/png doesn't look all that sharp before I put it through TexturePacker anyway.

It sounds like the files are using premultiplied alpha, which is why you're getting those outlines. If you can change the blending mode, try source = One, dest = OneMinusSourceAlpha instead of source = SourceAlpha, dest = OneMinusSourceAlpha (I don't use Unity so I don't know the blending mode names there)

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

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

:allears:
Well, I couldn't find any specific blend mode options, but I did discover that the "Alpha is Transparency" check box in the texture options is somehow messing it up. And that setting your texture type to GUI means that that check box is on. For some reason with that setting on, bits and pieces of the dark outlines don't show up, which looks REALLY bad. It still has darker outlines, but at least they're consistent and they don't look like like the blend mode problem anymore. Now, at least I have the mediocre BMFont font showing up as it was intended (I guess).

ahmeni
May 1, 2005

It's one continuous form where hardware and software function in perfect unison, creating a new generation of iPhone that's better by any measure.
Grimey Drawer
Are there any platforming physics articles out there that go alongside the actual code itself? I've picked through the Megaman slope style article and the N broad collision tutorial but I'm having trouble piecing together how these would look in code.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
Probably not, since giving you the code really doesn't help your understanding at all, and what platforming semantics you need depend on what type of game you want to make.

The N collision tutorial also seemed relatively straightforward to me. What issues are you having translating them into code?

ahmeni
May 1, 2005

It's one continuous form where hardware and software function in perfect unison, creating a new generation of iPhone that's better by any measure.
Grimey Drawer

Suspicious Dish posted:

Probably not, since giving you the code really doesn't help your understanding at all, and what platforming semantics you need depend on what type of game you want to make.

The N collision tutorial also seemed relatively straightforward to me. What issues are you having translating them into code?

I think I've got the handle on solid box collisions:

1) Get character AABB Rect
2) Project testing edge (left/right/up/down depending on -delta/+delta)
3) If projected point lies within a box, set new position as edge of box

It's where I'm hitting sloped edges that I'm not sure how to go about the translations for the slope collisions and so I was looking for something along the lines of someone explaining how they're doing point tests and results. The project itself is a little tile based platforming hack and slash.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
Have you read Metanet's first tutorial on Collision Detection and Response? Tutorial B is taking that first article and making it scale, so you really should read Tutorial A and make something that doesn't scale first so you understand it.

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

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

:allears:
Still learning Unity and I spent way too much time wondering why some positions weren't updating.

This is not allowed (gives an error):
code:
GameObject go;
go.transform.position.x = 5f;
This doesn't do anything (I assume it's modifying a copy instead of a reference):
code:
go.transform.position.Set(5f, 5f, 5f);
But THIS actually works:
code:
Vector3 pos = new Vector3(5f, 5f, 5f);
go.transform.position = pos;
Not exactly the most intuitive interface for something so basic.

Orzo
Sep 3, 2004

IT! IT is confusing! Say your goddamn pronouns!
transform.position returns a copy. So you're modifying the copy, not the original.

poemdexter
Feb 18, 2005

Hooray Indie Games!

College Slice

ZombieApostate posted:

Still learning Unity and I spent way too much time wondering why some positions weren't updating.

This is not allowed (gives an error):
code:
GameObject go;
go.transform.position.x = 5f;
This doesn't do anything (I assume it's modifying a copy instead of a reference):
code:
go.transform.position.Set(5f, 5f, 5f);
But THIS actually works:
code:
Vector3 pos = new Vector3(5f, 5f, 5f);
go.transform.position = pos;
Not exactly the most intuitive interface for something so basic.

Use transform.Translate(Vector3 translation);

http://docs.unity3d.com/Documentation/ScriptReference/Transform.Translate.html

ahmeni
May 1, 2005

It's one continuous form where hardware and software function in perfect unison, creating a new generation of iPhone that's better by any measure.
Grimey Drawer

Suspicious Dish posted:

Have you read Metanet's first tutorial on Collision Detection and Response? Tutorial B is taking that first article and making it scale, so you really should read Tutorial A and make something that doesn't scale first so you understand it.

It was my understanding that the Metanet N-style was built for platforming with collisions involving arbitrary polygons via the Separating Axis Theorem, which seemed like too big of a hurdle to tackle for the simple route I wanted to go with just 1:1 and maybe 1:2 slopes.

Flownerous
Apr 16, 2012

ZombieApostate posted:

Still learning Unity and I spent way too much time wondering why some positions weren't updating.

Not exactly the most intuitive interface for something so basic.

I think it's something everyone runs into now and then in C#. Structs are a bit awkward.

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.

ZombieApostate posted:

Still learning Unity and I spent way too much time wondering why some positions weren't updating.

This is not allowed (gives an error):
code:
GameObject go;
go.transform.position.x = 5f;
This doesn't do anything (I assume it's modifying a copy instead of a reference):
code:
go.transform.position.Set(5f, 5f, 5f);
But THIS actually works:
code:
Vector3 pos = new Vector3(5f, 5f, 5f);
go.transform.position = pos;
Not exactly the most intuitive interface for something so basic.
It's because you can't change Transform vectors directly (same applies to rotation and scale), you can only assign new ones (I assume this is so the Transform can react properly to the change), so yeah you can only do stuff like this:
code:
go.transform.position = new Vector3(5f, 5f, 5f);
You can also do this for relative changes:
code:
go.transform.Translate(5f, 5f, 5f); // instead of go.transform.position += new Vector3(5f, 5f, 5f);
It always trips you the first time but then you get used to it.

SupSuper fucked around with this message at 01:53 on Sep 4, 2013

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

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

:allears:
Yeah, I saw Transform.Translate(), but I was trying to set initial positions, so it was kind of awkward since the prefab I was instantiating already had a default transform.

It's just really annoying coming from C++, since they all would have either given a compile error (if position was private, for example) or flat out worked the way you would expect. It's one of the things I'm not wild about with regards to C#. Sure you could build something that would behave the same way in C++ (say, if you were caching the position and only updating it once per frame based on a series of translations during that frame), but then you'd probably make position private and force you to use functions to get/set instead. I'll get used to it eventually :downs:.

Orzo
Sep 3, 2004

IT! IT is confusing! Say your goddamn pronouns!

ZombieApostate posted:

It's just really annoying coming from C++, since they all would have either given a compile error (if position was private, for example) or flat out worked the way you would expect. It's one of the things I'm not wild about with regards to C#. Sure you could build something that would behave the same way in C++ (say, if you were caching the position and only updating it once per frame based on a series of translations during that frame), but then you'd probably make position private and force you to use functions to get/set instead. I'll get used to it eventually :downs:.
The problem here has nothing to do with language choice, though. If the property was instead named 'GetCopyOfPosition', and a method, you probably wouldn't have any complains with it. Or, if the Unity developers had implemented Vector3 as a class instead of a struct, you'd also get the expected behavior (but lesser performance--structs live on the stack, not the heap, and have advantages with respect to garbage collection).

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

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

:allears:
Oh, I'm not trying to say it's bad or anything, it just behaves differently than I'm used to, so my instincts are a bit off.

poemdexter
Feb 18, 2005

Hooray Indie Games!

College Slice

ZombieApostate posted:

Oh, I'm not trying to say it's bad or anything, it just behaves differently than I'm used to, so my instincts are a bit off.

If you're using Unity, there are usually better ways of setting initial position like in the inspector when your game object exists at start of scene or using the position parameter in Initiate.

http://docs.unity3d.com/Documentation/ScriptReference/Object.Instantiate.html

I totally get the frustration with some of the Unity stuff especially the Vector3 class. I was with you! If you're dead set on setting position in a traditional manner, I'd stick to
code:
transform.position = new Vector3(x,y,z);

Adbot
ADBOT LOVES YOU

xgalaxy
Jan 27, 2004
i write code

Orzo posted:

The problem here has nothing to do with language choice, though. If the property was instead named 'GetCopyOfPosition', and a method, you probably wouldn't have any complains with it. Or, if the Unity developers had implemented Vector3 as a class instead of a struct, you'd also get the expected behavior (but lesser performance--structs live on the stack, not the heap, and have advantages with respect to garbage collection).

You gotta admit its one of the weirder things about the language though, that you can create a property to a struct.
It's confusing if you aren't paying attention or aren't familiar with how C# handles class vs struct. They need better compiler warnings on it if nothing else.

xgalaxy fucked around with this message at 02:57 on Sep 4, 2013

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