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
The Insect Court
Nov 22, 2012

by FactsAreUseless
Apropos, any recommendations for cross-platform 2d game engines that support at least iOS and Android(Win 8/desktop/html5 would be nice but are secondary)? I asked this in the general programming thread but it seems more relevant here. The best documented and most mature frameworks seem to be the commercial ones like Marmalade/Corona/ImpactJS, etc. There's also cocos2d, which has the upside of being free and open-source and seems to have bindings in various languages. Any stand-outs, or ones to avoid?

Adbot
ADBOT LOVES YOU

Shalinor
Jun 10, 2002

Can I buy you a rootbeer?

Coldrice posted:

My question is if I want to make a more serious step into game development am I shooting myself in the foot with objective-c? I have no ability to port to android or pc which is my first concern. Second, I'm worried that "depth" isn't really necessary for the mobile market as much as a catchy casual game that can be played for a minute than put away. I like the "idea" of mobile games but I worry my ideas are better suited for the desktop than a phone. Thoughts? I can spend the next few months learning a new language and set of tools, or I can dive into the next thing. Not sure
It depends on your goals.

If you want to have a portfolio good for breaking into the industry, having a few native apps AND a few higher level apps would be very good. So there, it does actually make sense to write an ObjC game, and hand port it to Java later, etc.

... but if this is strictly for your own purposes, or especially for trying to break into indie successfully? Never, ever write native. You have to value portability and maneuverability over all else, and in practice, you'll never be writing a game large enough for the inherent performance overhead to matter. Personally I did Unity, but there are all the usual suspects out there for frameworks. Whichever you pick, just pick one - don't go native.

xgalaxy
Jan 27, 2004
i write code
Where is the LibGDX equivalent on the C# side?
I hate MonoGame, mostly because I hate XNA.
And OpenTK is more like the equivalent of LWJGL.

LibGDX is just a nice simple library. Higher level than LWJGL but not API soup like MonoGame.

SavageMessiah
Jan 28, 2009

Emotionally drained and spookified

Toilet Rascal

yaoi prophet posted:



A really tiny thing I made in Haskell using netwire, GLFW, and lens (about 250 loc). You can move around and shoot projectiles, and that's it. I'm hoping to make it into an actual game, and maybe start up a development blog about it since game development is something there's really not a lot of in Haskell.

I'd really like to read that blog, everytime I try to look at game stuff in Haskell I get lost figuring out how to make the state work rationally. FRP + lenses sounds pretty cool.

Opinion Haver
Apr 9, 2007

SavageMessiah posted:

I'd really like to read that blog, everytime I try to look at game stuff in Haskell I get lost figuring out how to make the state work rationally. FRP + lenses sounds pretty cool.

Yeah, there's not a lot out there besides the Yampa Arcade paper. It's pretty unfortunate.

Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."
yaoi prophet: That's a useful link. I just started tinkering with implementing FRP in a concatenative language and it's helpful to see more worked-out examples.

Coldrice
Jan 20, 2006


Shalinor posted:

Whichever you pick, just pick one - don't go native.

Great post, this is just what I was looking for. Unity has been in my sights for a while now, so I think I'll spend some time learning how to use it. The price of unity was my only barrier initially

Opinion Haver
Apr 9, 2007

Internet Janitor posted:

yaoi prophet: That's a useful link. I just started tinkering with implementing FRP in a concatenative language and it's helpful to see more worked-out examples.

One thing that I don't like is its merging of the output of all kinds of objects (gun, missile, alien) into one ObsObjState. My code only does that when it needs to in the spawning code (since you spawn something by outputting a list of wires you want to create, and the game stepper then inserts them into the appropriate collection); I have different output types for different objects. This way I can't accidentally have a projectile turn into a player or something. Similarly, by making the input types different, I can ensure that my projectiles can't depend on player input. I'm going to write this technique up once i have a bit more up, such as moving targets for projectiles to hit.

poemdexter
Feb 18, 2005

Hooray Indie Games!

College Slice

The Insect Court posted:

Apropos, any recommendations for cross-platform 2d game engines that support at least iOS and Android(Win 8/desktop/html5 would be nice but are secondary)? I asked this in the general programming thread but it seems more relevant here. The best documented and most mature frameworks seem to be the commercial ones like Marmalade/Corona/ImpactJS, etc. There's also cocos2d, which has the upside of being free and open-source and seems to have bindings in various languages. Any stand-outs, or ones to avoid?

Unity and Futile 2D plugin. I'm using it and loving it way more than when I was doing XNA exclusively. Little to no documentation, but the reddit thread for Furtile is very active.

KoRMaK
Jul 31, 2012



HappyHippo posted:

In each cell every node is connected to every other node, unless there's a wall in the way. In a cell with 4 nodes that means 3 + 2 + 1 = 6 edges. If there are 5 nodes, then there's 10 edges. Cells have a methods to add/remove nodes and walls, afterwards they recheck all their edges to see which ones are allowed.


Those are the original values, in the top left.
When would you want to add more than 4 nodes? Could you bust out some pseduo-code on the logic that goes on inside your node walking loop?

HappyHippo posted:

Those are the original values, in the top left.
But how does that value fit in to a lerp operation?

KoRMaK fucked around with this message at 23:36 on Feb 24, 2013

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!

KoRMaK posted:

When would you want to add more than 4 nodes?
When there's a partial barrier in the cell I'd think. Stick a blocking square, smaller than a cell, in the center of a cell and you need 4 additional nodes to be able to navigate up to and around that square, since otherwise there would be no paths to anywhere closer to it than the edge of the cell. With a blocking circle you could have any number of additional nodes to describe it accurately, presumably you'd have some sort of maximum resolution (or minimum distance between nodes) to prevent that from getting silly.

Though really doesn't each (empty, non-edge) cell kind of only have one node, or four quarter-nodes, in the sense that an empty grid of 50x50 cells doesn't have 50x50x4 nodes.

Scaevolus
Apr 16, 2007

Are there any benefits of FRP in comparison to a normal non-pure language's mutable objects?

It seems like it requires an elaborate arrangement of events and state transitions to support basic updates.

Opinion Haver
Apr 9, 2007

At least in Haskell, part of it is the usual 'management of state' thing; I can be sure that one object can't reach in to other objects' state and screw with it in arbitrary ways. You also get composability; if I have two wires, I can just hook up the input of one to the output of another using the usual composition operator.

Xand_Man
Mar 2, 2004

If what you say is true
Wutang might be dangerous


I haven't played with YAMPA at all, but given it's functional nature would something like this be doable?

(Bret Victor: designing on Principle, jump to the 11m mark for the game demo)
http://vimeo.com/36579366

Opinion Haver
Apr 9, 2007

Do you mean the whole 'play around with stuff live' thing? If so, no, because Haskell is a compiled language and you can't really do that kind of live coding in it without some hackery.

Also, it's not actually that verbose; the code for managing wires is sort of messy, but this is the entire code for constructing a projectile at the given start point that moves towards the target (the ObjectOutput [] means that it never spawns any objects):

code:
projectileWire :: GamePosition -> GamePosition ->
                  WireP () (ObjectOutput Projectile)
projectileWire start target = proc () -> do
    position <- integral_ start -< velocity
    returnA -< ObjectOutput [] $ Projectile position
      where velocity = 200 *^ normalized (target ^-^ start)

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

roomforthetuna posted:

When there's a partial barrier in the cell I'd think. Stick a blocking square, smaller than a cell, in the center of a cell and you need 4 additional nodes to be able to navigate up to and around that square, since otherwise there would be no paths to anywhere closer to it than the edge of the cell. With a blocking circle you could have any number of additional nodes to describe it accurately, presumably you'd have some sort of maximum resolution (or minimum distance between nodes) to prevent that from getting silly.

Though really doesn't each (empty, non-edge) cell kind of only have one node, or four quarter-nodes, in the sense that an empty grid of 50x50 cells doesn't have 50x50x4 nodes.

Nodes in the corners and on edges are shared between the cells. Or rather, they count as being part of both cells. So yeah, 50x50 would have 51x51 nodes.

KoRMaK posted:

When would you want to add more than 4 nodes? Could you bust out some pseduo-code on the logic that goes on inside your node walking loop?

But how does that value fit in to a lerp operation?

Imagine a cell with a coastline running through it, so that the coastline cuts off one corner. There would be 5 nodes: one each in the three corners on land, and two more where the coastline intersects the cell edges. And of course as roomforthetuna describes, when a unit walks through a cell more nodes appear as well to allow pathfinding around it. Without adding nodes the whole thing reduces to grid based pathfinding. I don't know what you mean by node walking.

For marching squares, for the moment just think about the cell I just described. You have heightmap values for each of the four corners, and a cutoff value that defines "sea level". So three of the values are above sea level and thus land, and the fourth is below sea level and therefore water. Now for marching squares you look at the four edges of the cell. So if for an edge you have one end above sea level and the other end below sea level then clearly the coastline must intersect the edge. Taking the values at the end points you use linear interpolation to estimate where it intersects. That's what that last step in that (very poorly drawn) diagram from wikipedia is doing. For example, if zero is sea level, corner values of +10 and -10 would have the coastline intersect at the middle of the edge, while +9 and -1 would have the intersection 9/10ths of the way along the edge.

Surprise T Rex
Apr 9, 2008

Dinosaur Gum
Are there going to be any negative effects from coding a game in an interpreted language like Python? It's what I'm learning at University at the moment and I figure that I might try to knock out a really simple game in my spare time.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
As a short game that you don't expect to distribute, sure. Python is just very immature for real game development -- even though I love the language, I wouldn't recommend to build a game.

Scaevolus
Apr 16, 2007

Surprise T Rex posted:

Are there going to be any negative effects from coding a game in an interpreted language like Python? It's what I'm learning at University at the moment and I figure that I might try to knock out a really simple game in my spare time.
Python is generally faster to write, but executes slower.

For simple games, you should be fine.

Most 2D games could be written in Python, but 3D usually requires better performance.

xzzy
Mar 5, 2009

Scaevolus posted:

Most 2D games could be written in Python, but 3D usually requires better performance.

Panda3D is surprisingly good though.

The biggest failing of python is mobile or web distribution.. basically, it ain't happening.

KoRMaK
Jul 31, 2012



HappyHippo posted:

Nodes in the corners and on edges are shared between the cells. Or rather, they count as being part of both cells. So yeah, 50x50 would have 51x51 nodes.


Imagine a cell with a coastline running through it, so that the coastline cuts off one corner. There would be 5 nodes: one each in the three corners on land, and two more where the coastline intersects the cell edges. And of course as roomforthetuna describes, when a unit walks through a cell more nodes appear as well to allow pathfinding around it. Without adding nodes the whole thing reduces to grid based pathfinding. I don't know what you mean by node walking.

For marching squares, for the moment just think about the cell I just described. You have heightmap values for each of the four corners, and a cutoff value that defines "sea level". So three of the values are above sea level and thus land, and the fourth is below sea level and therefore water. Now for marching squares you look at the four edges of the cell. So if for an edge you have one end above sea level and the other end below sea level then clearly the coastline must intersect the edge. Taking the values at the end points you use linear interpolation to estimate where it intersects. That's what that last step in that (very poorly drawn) diagram from wikipedia is doing. For example, if zero is sea level, corner values of +10 and -10 would have the coastline intersect at the middle of the edge, while +9 and -1 would have the intersection 9/10ths of the way along the edge.
This is now becoming more clear for me. Let's take this guy for example though:
(probably have to zoom in on it)

How do you figure out where the intersection is and where to put the nodes I marked with yellow?

This one too, the intersection doesn't take place in the middle, so how do you determine where to put the new node? Collision test with the border of the unit exclusion zone and the edge in question?

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

KoRMaK posted:

This is now becoming more clear for me. Let's take this guy for example though:
(probably have to zoom in on it)

How do you figure out where the intersection is and where to put the nodes I marked with yellow?

This one too, the intersection doesn't take place in the middle, so how do you determine where to put the new node? Collision test with the border of the unit exclusion zone and the edge in question?


OK first to avoid confusion it's important to distinguish the two uses of the word "edge": 1) There's the edges of the cells. This is the sense I was using in the post you quoted. From here on I'll use the word "border" for this. 2) There are edges that join nodes in the graph used for pathfinding. These are the grey lines in the pictures I posted.

Now that that's cleared up: Marching squares is only used for the terrain generation aspect of the graph, such as finding the nodes with the blue "lakes." The yellow nodes there aren't created that way. Basically what you said, you just add the nodes where the border of the unit exclusion zone intersects with the border of the cell. Cells can share nodes but edges (in the graph sense) never cross cells, so I had to put nodes where the borders of the unit box intersect the border of the cell.

Paniolo
Oct 9, 2007

Heads will roll.

xzzy posted:

Panda3D is surprisingly good though.

The biggest failing of python is mobile or web distribution.. basically, it ain't happening.

I find the biggest failing of Python and interpreted languages in general is the ability to write bugs that would be caught at compile time in other languages. Normally you rely on unit testing to catch them but if you aren't doing that I'm convinced using an interpreted language is a net drain on productivity.

Ulta
Oct 3, 2006

Snail on my head ready to go.
I was doing some quick prototyping in Gamemaker, and I was having trouble with my sprite getting stuck inside my walls. Am I doing something noobish and dumb?



code:
//this is during the step event of the player object
//vsp is the vertical speed, hsp is the horizontal speed

//check and see if movement will cause a collision
if(place_meeting(x+hsp, y+vsp, obj_solid_parent))
{
   //get as close as possible without touching
   while(!place_meeting(x+sign(hsp)*1,y +sign(vsp)*1, obj_solid_parent))
   {
     y+=sign(vsp)*1;
     x+=sign(hsp)*1;     
   }
   
   //see if the collision is in the horizontal, if so
   //stop the horizontal speed and move back some 
   if(place_meeting(x+sign(hsp)*1,y, obj_solid_parent))
   {
      hsp = 0;
      x-=sign(hsp)*2;
   }

   //see if the collision is in the vertical, if so
   //stop the vertical speed and move back some 
   if(place_meeting(x, y+sign(vsp)*1, obj_solid_parent))
   {
      vsp = 0; 
      y-=sign(vsp)*2;     
   }
}

//do movement
x+=hsp;
y+=vsp;

Azazel
Jun 6, 2001
I bitch slap for a living - you want some?

yaoi prophet posted:

where velocity = 200 *^ normalized (target ^-^ start)

Did anyone else think to themselves "Whoa, Haskell has built in emoji?" when seeing this?

If not, carry along.

RoboCicero
Oct 22, 2009

"I'm sick and tired of reading these posts!"

Ulta posted:

I was doing some quick prototyping in Gamemaker, and I was having trouble with my sprite getting stuck inside my walls. Am I doing something noobish and dumb?
<snip>

I'm fairly sure the issue is here :
code:
//do movement
x+=hsp;
y+=vsp;
You run this code even if there was a collision. Since you already did code to bump the sprite so it's only just touching the block, this code shoves the sprite forward into the object anyway.

Adding an else should fix the problem :

code:
if(place_meeting(x+hsp, y+vsp, obj_solid_parent))
{
 // collision stuff
}
else
{
//do movement
  x+=hsp;
  y+=vsp;
}

Ulta
Oct 3, 2006

Snail on my head ready to go.

RoboCicero posted:

I'm fairly sure the issue is here :
code:
//do movement
x+=hsp;
y+=vsp;
You run this code even if there was a collision. Since you already did code to bump the sprite so it's only just touching the block, this code shoves the sprite forward into the object anyway.

Adding an else should fix the problem :

code:
if(place_meeting(x+hsp, y+vsp, obj_solid_parent))
{
 // collision stuff
}
else
{
//do movement
  x+=hsp;
  y+=vsp;
}

Ah ha!

That was almost it. Had to add an additional else within the code block to allow for movement if the collision was on one axis and not the other. Also had a minor bug in the collision check where I wasn't using the speed.

code:
if(place_meeting(x+hsp, y+vsp, obj_solid_parent))
{
   //get as close as possible without touching
   while(!place_meeting(x+sign(hsp)*1,y +sign(vsp)*1, obj_solid_parent))
   {
     y+=sign(vsp)*1;
     x+=sign(hsp)*1;     
   }
   
   //see if the collision is in the horizontal, if so
   //stop the horizontal speed and move back some 
   if(place_meeting(x+[b]hsp[/b],y, obj_solid_parent))
   {
      hsp = 0;
      x-=sign(hsp)*1;
   }
   else //its fine to do movement
   {
      x+=hsp;
   }
   //see if the collision is in the vertical, if so
   //stop the vertical speed and move back some 
   if(place_meeting(x, y+vsp, obj_solid_parent))
   {
      vsp = 0; 
      y-=sign(vsp)*1;     
   }
   else
   {
      y+=vsp;
   }
   
   //allow jumping if we are stopped vertically   
   if(vsp == 0)
   {
      grounded = true;
   }
}
else
{
   grounded = false;
   //do movement
   x+=hsp;
   y+=vsp;
}

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!

Ulta posted:

That was almost it. Had to add an additional else within the code block to allow for movement if the collision was on one axis and not the other. Also had a minor bug in the collision check where I wasn't using the speed.
It's probably a neater solution to make your collision set hsp or vsp to zero as appropriate - that way you don't need to 'else' the movements, and you won't get weird effects like, the way you have it now, if you accelerate left, hit a block and are stopped, then move up until you're past the block, your speed resumes where it left off rather than having to re-accelerate.

(Or setting it to a small amount outwards, proportional to current speed, if you want a little bounce.)

xgalaxy
Jan 27, 2004
i write code
So I need to pimp out a new game engine written by some friends and former colleagues from my time at GarageGames.
It's really amazing, and well, I'll just let the video speak for itself.

Loom from http://theengine.co
https://www.youtube.com/watch?v=iXPaYv_WcU8

The Gripper
Sep 14, 2004
i am winner

xgalaxy posted:

So I need to pimp out a new game engine written by some friends and former colleagues from my time at GarageGames.
It's really amazing, and well, I'll just let the video speak for itself.

Loom from http://theengine.co
https://www.youtube.com/watch?v=iXPaYv_WcU8
I would love to try this on Windows but the CLI installer forcibly installs on C:\ (probably whatever the system default is) which isn't an option for me, and also installs a full version of ruby that doesn't work properly because the path has a space in the name apparently (which broke my system ruby version, somehow).

The videos and docs look good though!

xgalaxy
Jan 27, 2004
i write code

The Gripper posted:

I would love to try this on Windows but the CLI installer forcibly installs on C:\ (probably whatever the system default is) which isn't an option for me, and also installs a full version of ruby that doesn't work properly because the path has a space in the name apparently (which broke my system ruby version, somehow).

The videos and docs look good though!

I'll let them know but you should really head to their forums and tell them.
I'm not involved in the project in any way other than having beers every once in awhile :)

DrMelon
Oct 9, 2010

You can find me in the produce aisle of the hospital.

xgalaxy posted:

So I need to pimp out a new game engine written by some friends and former colleagues from my time at GarageGames.
It's really amazing, and well, I'll just let the video speak for itself.

Loom from http://theengine.co
https://www.youtube.com/watch?v=iXPaYv_WcU8

That's really neat. I'll have to have a crack at making something with this, it's very, very nice!

Yodzilla
Apr 29, 2005

Now who looks even dumber?

Beef Witch
That looks pretty cool! Maybe I'll give it a shot when I have a chance.

The Gripper
Sep 14, 2004
i am winner

xgalaxy posted:

So I need to pimp out a new game engine written by some friends and former colleagues from my time at GarageGames.
It's really amazing, and well, I'll just let the video speak for itself.

Loom from http://theengine.co
https://www.youtube.com/watch?v=iXPaYv_WcU8
Another comment on this since I've been playing with it, but this actually works really well for development while I'm travelling with a lovely netbook since loom run --android pretty much offloads all my regular fiddly edit->compile->deploy tasks onto my phone with the liveupdate feature.

If it ever gains enough traction to get some solid 3D support it looks like it'll be something super useful for rapid development.

Bondematt
Jan 26, 2007

Not too stupid
Think I found my first legitimate bug in Unity.

I have a ship that is created with a rigid body, then I add a bunch of primitive colliders to it. If I don't set the collision detection to anything other than what it is instantiated with I can penetrate deeply into the colliders and get stuck, but if I set it and then even set it right back to what it started as it works fine. It's almost like it is going to sleep immediately and collisions don't wake it up and keep it up. Also after the collisions where I am inside it, once I get out it stops again, even if it is spinning one rotation every few seconds.

Restarts haven't done anything, and nothing is acting upon the rigidbody other than adding colliders and mass.

Shalinor
Jun 10, 2002

Can I buy you a rootbeer?

Bondematt posted:

I have a ship that is created with a rigid body, then I add a bunch of primitive colliders to it.
Unity does weird things if you add a bunch of colliders to a single rigid body. If you add a child to a rigid body object and give it a collider but no rigid body, for instance, then it sort of collapses the collider back into the parent - but not completely / it's weird.

You might try making those other colliders child objects, and adding a kinematic rigid body to each.

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!

Shalinor posted:

You might try making those other colliders child objects, and adding a kinematic rigid body to each.
According to the documentation, don't add a rigidbody to the child objects. See the bit under "Compound Colliders" here.

Bondematt
Jan 26, 2007

Not too stupid
Tried both ways, with a kinematic rigidbody on the children with colliders it treats the colliders as kinematic, so nothing gets through to the parent ship rigidbody.

Having a non-kinematic with low weight had the same issue as no rigidbody on the child objects, and toggling collision detection fixed it like before.

Edit: I should mention each collider is on a prefab child gameobject.

I am changing the colliders size after it is instantiated as well, to cover the tile objects it is replacing.

Bondematt fucked around with this message at 18:48 on Feb 27, 2013

Shalinor
Jun 10, 2002

Can I buy you a rootbeer?

roomforthetuna posted:

According to the documentation, don't add a rigidbody to the child objects. See the bit under "Compound Colliders" here.
That works when you need a rigid representation. The way it works if those additional colliders are triggers, though, struck me as a bit odd. The behavior with distinct rigid bodies for each trigger is more what I'd expect.

(I misunderstood the problem, I thought he was looking for additional trigger colliders, not rigid)

Adbot
ADBOT LOVES YOU

Joda
Apr 24, 2010

When I'm off, I just like to really let go and have fun, y'know?

Fun Shoe
Does anyone here know if articy is good for planning out games beyond just story structure and character development (i.e. does it have more programmer oriented tools?) I just noticed it on Steam, and I've been looking for an all-in-one tool for all the planning of a game project I want to start working on (a fairly simple platformer with some rudimentary RPG and strategy elements.)

What I'd ideally use it for is prototyping the flow of the game, while attaching different elements to classes in a UML diagram and to test that various features work as they should. For instance, rather than having to design the whole game first, just test that all save data is correctly stored and loaded from a hashmap and such. Can it be used for this kind of thing?

My initial impression is that it's more geared towards simple, dialogue based games like point and clicks, but sometimes PR departments downplay more advanced features (such as UML class diagrams) to not scare away people who don't have any programming experience.

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