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 Glumslinger
Sep 24, 2008

Coach Nagy, you want me to throw to WHAT side of the field?


Hair Elf
Welp, I thought I was using a triangle list :downs:

Adbot
ADBOT LOVES YOU

StealthArcher
Jan 10, 2010




AntiPseudonym posted:

The way I did tile-based collision in my Minecraft clone was via conservative line rasterisation, which would scale down to 2D incredibly easily.

You rasterize a line against your tile grid, and then step through each cell to see if the tile is solid or not. If it is, you can get the intersection of the line to get the collision point, and you can get the collision normal by storing when side of the cell the line entered last. You can test arbitrary rectangles pretty easily by transforming the dimensions of the grid, too.

It's quite fast and reliable in my experience, I'll try and post some code for it on the weekend if anyone's interested.


If you still feel up to this, I would like to see it.

qwertyasdf
Nov 11, 2003

I am looking at HTML5/Javascript game engines to write some fun stuff in. I was looking around and found http://impactjs.com/, which is only $50 at the moment. I was wondering if anyone had used this and had thoughts on it, or if there is a superior platform elsewhere.

I am an artist, but I am a decent programmer for a hobbyist. I can usually hack out the logic I need, but probably have no business rolling my own engine. I want something that I can rapidly prototype.

I don't really like flash, but I know its still probably the fastest flexible choice that most people still use. I would rather avoid it if I could.

beauty queen breakdown
Dec 21, 2010

partially cromulent posting.
"2021's worst kept secret"


Addict posted:


I am an artist, but I am a decent programmer for a hobbyist. I can usually hack out the logic I need, but probably have no business rolling my own engine. I want something that I can rapidly prototype.


Sadly, I can't answer the question about Impact for you -- but I am leery of anything that claims to have an efficient mechanism already in place for triggered events or an easy to use yet effective world-building system.

However, I'm terrible at drawing and always looking for someone to jam with. When goaded I have been known to produce engines rapidly. If you ever need a programmer to work with I'm usually up for collaborations.

Shalinor
Jun 10, 2002

Can I buy you a rootbeer?

Addict posted:

I don't really like flash, but I know its still probably the fastest flexible choice that most people still use. I would rather avoid it if I could.
HTML5 still runs like a dog's rear end in most browsers, will for a few years yet, and has limited support by game developers as a result. Presently, you only use HTML5 to get a jump on the next big thing a/o because it's cool, not because it's effective. That library is $50 because no one else has bothered building a competing one yet.

... so personally, I'd recommend considering Flash, if your goal is in fact to rapidly prototype (Flash/Flixel is prominent for a reason). If you want to experiment with cool stuff because it is cool, then HTML5's a fine choice. You would also be well served to look into Unity, which will eventually be capable of exporting to Flash as well as HTML5.

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:

[...] Unity, which will eventually be capable of exporting to Flash as well as HTML5.
I actually just got an email from Unity today saying that version 3.5 is now in public beta, and it implies that this version can export to Flash, though I guess these words could just mean they have a preview video or something:

quote:

This release also provides a hands-on preview of Unity's upcoming Flash deployment add-on. Experience first-hand how Flash deployment in Unity opens up new publishing options, by enabling you to push your interactive 3D content to the web through Adobe Flash Player.

ambushsabre
Sep 1, 2009

It's...it's not shutting down!

roomforthetuna posted:

I actually just got an email from Unity today saying that version 3.5 is now in public beta, and it implies that this version can export to Flash, though I guess these words could just mean they have a preview video or something:

It can export to flash. They also added some other neat stuff worth checking out. Also, you should totally just go flash / flixel because it's really nice and easy to get into. I am a great flixel salesman so ask me anything!

qwertyasdf
Nov 11, 2003

Lord Byron III posted:

However, I'm terrible at drawing and always looking for someone to jam with. When goaded I have been known to produce engines rapidly. If you ever need a programmer to work with I'm usually up for collaborations.

That sounds fun, but I have my hands tied up in a film at the moment. I am just kind of exploring options for an idea I had when the film is done.

Shalinor posted:

... so personally, I'd recommend considering Flash, if your goal is in fact to rapidly prototype (Flash/Flixel is prominent for a reason). If you want to experiment with cool stuff because it is cool, then HTML5's a fine choice. You would also be well served to look into Unity, which will eventually be capable of exporting to Flash as well as HTML5.

I have seen unity. I didn't know it could (soon) export to flash/HTML5. I figured it was another proprietary web plugin that nobody would want to install. I don't have a lust for the cutting edge of tech. I prefer the well supported with documentation, tools, and examples. The whole viewing on smartphones/tablets, and even being able to compile apps and export to the web at the same time is what drew me towards the HTML5 idea.

How robust are Unity's 2d components? I don't need a shitload of 3d power. I can make use of it for backgrounds but I was planning to just paint them and fake parallax scrolling.

ambushsabre posted:

It can export to flash. They also added some other neat stuff worth checking out. Also, you should totally just go flash / flixel because it's really nice and easy to get into.

I don't like in flash you can't right click and I don't like working with Flash/Actionscript too much. If it is the easiest/fastest solution I am more than willing to look into it though.

Thanks for the answers, I am glad I bothered to ask people who know what the gently caress is going on.

qwertyasdf fucked around with this message at 02:48 on Dec 23, 2011

Shalinor
Jun 10, 2002

Can I buy you a rootbeer?

Addict posted:

Thanks for the answers, I am glad I bothered to ask people who know what the gently caress is going on.
Tit for tat - now you have to tell us who the dude in your avatar is, and why he's eating a monster sandwich.

Also, as for Unity 2D. Natively, it does 2D "ok" - about like doing 2D in any 3D engine. There are a variety of plugins, though, that make it very easy, and quite a few 2D games have been made with it. Like, say, Svampson's awesome thing:

https://www.youtube.com/watch?v=4NORxMyr9xQ

qwertyasdf
Nov 11, 2003

Shalinor posted:

Tit for tat - now you have to tell us who the dude in your avatar is, and why he's eating a monster sandwich.

Also, as for Unity 2D. Natively, it does 2D "ok" - about like doing 2D in any 3D engine. There are a variety of plugins, though, that make it very easy, and quite a few 2D games have been made with it. Like, say, Svampson's awesome thing:

https://www.youtube.com/watch?v=4NORxMyr9xQ

It's kid flash from the comic series I think called young justice. I googled a bit but only found examples where he looks like a massive tool. I nicked the avatar's panel from a thread in BSS forever ago. He's eating a giant sandwich because who wouldn't? My metabolism, like his, is absurdly high.

e: http://dc.wikia.com/wiki/Bart_Allen more info on the one in my avatar, he's called Impulse

That unity demo seems pretty cool. I will look more into it and see if it fits my needs. The new one seems to have path finding which is nice, and an easy to use particle system.

It seems pretty funny that I could go get a number of industry quality 3D engines like the UDK that have absurdly powerful tools and tech, but there doesn't seem to be a 2D equivalent.

qwertyasdf fucked around with this message at 03:25 on Dec 23, 2011

Svampson
Jul 29, 2006

Same.

Shalinor posted:

Also, as for Unity 2D. Natively, it does 2D "ok" - about like doing 2D in any 3D engine. There are a variety of plugins, though, that make it very easy, and quite a few 2D games have been made with it. Like, say, Svampson's awesome thing:

Pfft that is old hat uploaded a new video earlier today featuring an early test room * 3

https://www.youtube.com/watch?v=_OPtejaAark

My only regret is that I don't have Unity Pro so I can grossly misuse Depth of Field effects :(

vv Thanks and yeah I'm using 2D Toolkit

Svampson fucked around with this message at 04:15 on Dec 23, 2011

ambushsabre
Sep 1, 2009

It's...it's not shutting down!

Svampson posted:

Pfft that is old hat uploaded a new video earlier today featuring an early test room * 3

https://www.youtube.com/watch?v=_OPtejaAark

My only regret is that I don't have Unity Pro so I can grossly misuse Depth of Field effects :(

It's stuff like this that encourages me to make cooler stuff. Are you using 2dTK for unity or what?

Rupert Buttermilk
Apr 15, 2007

🚣RowboatMan: ❄️Freezing time🕰️ is an old P.I. 🥧trick...

Svampson posted:

Pfft that is old hat uploaded a new video earlier today featuring an early test room * 3

https://www.youtube.com/watch?v=_OPtejaAark

My only regret is that I don't have Unity Pro so I can grossly misuse Depth of Field effects :(

vv Thanks and yeah I'm using 2D Toolkit

Dude, I can't wait to get you some awesome sounds. It's all going to sound so violent.

duck monster
Dec 15, 2004

Whilar studying up on this Unity thing , I've come to the conclusion Boo is an incredibly fun little language, sort of like Python on drugs, really good drugs.

TJChap2840
Sep 24, 2009
Any opinions on SDL?

ambushsabre
Sep 1, 2009

It's...it's not shutting down!

TJChap2840 posted:

Any opinions on SDL?

I would say that unless you *really* need the low-level control C++ and SDL offers, go with C# and XNA. It'll just be less painful from the start.

Jewel
May 2, 2009

ambushsabre posted:

I would say that unless you *really* need the low-level control C++ and SDL offers, go with C# and XNA. It'll just be less painful from the start.

My only problem with XNA is the amount of stuff it has to pack in to be installed on another computer without XNA on it. SDL is a lot more lightweight in that regard.

TJChap2840
Sep 24, 2009

ambushsabre posted:

I would say that unless you *really* need the low-level control C++ and SDL offers, go with C# and XNA. It'll just be less painful from the start.

On this topic, I primarily code in C#. I have a few friends that work at an iPhone app development studio that are good with C++ and are trying to push me to use said language. Aside from being available on all systems, are there any other reasons I should consider the switch?

ambushsabre
Sep 1, 2009

It's...it's not shutting down!

TJChap2840 posted:

On this topic, I primarily code in C#. I have a few friends that work at an iPhone app development studio that are good with C++ and are trying to push me to use said language. Aside from being available on all systems, are there any other reasons I should consider the switch?

C++ is really really good for low-level control. It let's you manage memory and lots of other things that I'm sure C# can do, but very little of it is automatic like C# (garbage collection comes to mind, I'm not sure if C++ has automatic or if I'm thinking of C). I believe app development is objective-c too, so I'm not sure what the differences are. Honestly unless you really want to reach all of the platforms, I would stick to C#. You could also look at Unity for games, which allows you to write in C# and export to every platform (except for linux).

PalmTreeFun
Apr 25, 2010

*toot*
Neither C++ nor C have automatic garbage collection. In fact, C is harder because it's basically C++ without object-oriented features. It's no assembly, but it's still a bit tricky, especially compared to C# or Java.

duck monster
Dec 15, 2004

TJChap2840 posted:

Any opinions on SDL?

SDLs more a compatibility and low-levelness layer. Like Direct2d or something, cept it works on lunix and macs too. You probably want to find a nice little engine that sits up a level higher on top of SDL. That said, if you like the feel of metal, sure , why the gently caress not, means i can play your game too (mac).

Bisse
Jun 26, 2005

I'm wondering if it'd be possible to do a Win/OsX/Linux/iOS cross-platform game engine using C++ / OpenGL?

I'm looking to develop a simple 3D game (voxels! :downs: ) and, just for the sake of learning and experience, don't want to use any generic tool like Unity3D. Win/OsX/Linux should be banal - it's the iOS part i'm worried about. It all comes down to that is has to work with XCode and the iPhone has to handle it non-horribly.

How's the support for it if I do the engine with just mostly C++ standard libraries and GLUT? Any pitfalls I should look out for? Would I be better off doing this in C# or Objective C?

mewse
May 2, 2006

it would probably be easier to develop for ios then port to a full desktop platform because i think ios uses opengl ES, a subset of full opengl

Vino
Aug 11, 2010
I recommend GLFW instead of Glut or even Freeglut.

There is nothing technically preventing you from writing C++/OpenGL on all of those platforms but you will be writing code that is specific to only some platforms. For iOS my understanding is that you have to write a bunch of wrappers in objective c to get at the iOS internals.

If you target OpenGL 2 or 3 on the desktop and don't use any of the immediate mode stuff it should be pretty easy to port to OpenGL ES.

h_double
Jul 27, 2001
I want to do 2D game development in C# and write code which can run on MacOS and Windows (Linux would be a nice perk too). From what I can tell, Mono + MonoDevelop + SFML looks to be the most attractive solution, but I'm completely new to .NET/Mono and having a hard time getting all the pieces to work together.

Two questions, one about setting up SFML, one more general:

1) I have the main C++ SFML (1.6) framework installed, able to build and run test apps in Xcode. I'm trying to get the C#/.NET bindings for SFML working, and am not sure how to make it all fit together. It doesn't look hyper-complex, but the process of installing the .NET bindings via Mono is not well documented, and I haven't been able to find any good answers on the SFML support forum. I THINK I'm able to build the .NET bindings in MonoDevelop using the solution file bundled with the sources; it creates a few .dll files but I have no idea where I am supposed to put them or how to reference them in other code. From what I can tell, MonoDevelop doesn't use GAC to track installed assemblies, but uses pkg-config instead. I think maybe I need to get the SFML .NET bindings into an assembly and register that with pkg-config somehow? Does any of this make any sense?


2) Apart from SFML.NET, are there other toolkits/environments I should consider? I want something higher level than C++, that doesn't cost money to license (so Unity isn't attractive) that has native gamepad/controller support. AS3 (Flashpunk) is what I've been using most recently, which I love from a coding standpoint, but the Flash VM is such a loving turd and I'm not confident about the future prospects of the Flex SDK. Anything else I should look into?

h_double fucked around with this message at 02:37 on Dec 29, 2011

ambushsabre
Sep 1, 2009

It's...it's not shutting down!
Let's talk cocos2d for iOS. Thoughts? I have an ~4 year old mac (one of the dual core intel ones) and plenty of iOS devices, if I sign up for the dev thing so I can test right on the device will I be able to compile and load my stuff in a timely manner? I guess this isn't a cocos2d specific question and more of a mac app dev one, but I'd like to know what you're thoughts are on the library itself.

duck monster
Dec 15, 2004

ambushsabre posted:

Let's talk cocos2d for iOS. Thoughts? I have an ~4 year old mac (one of the dual core intel ones) and plenty of iOS devices, if I sign up for the dev thing so I can test right on the device will I be able to compile and load my stuff in a timely manner? I guess this isn't a cocos2d specific question and more of a mac app dev one, but I'd like to know what you're thoughts are on the library itself.

Cocos2d is fantastic. Very easy to use, and has some nice shiny about it too.

TJChap2840
Sep 24, 2009

duck monster posted:

Cocos2d is fantastic. Very easy to use, and has some nice shiny about it too.

And there is also Cocos2d-x which allows you to code in C++ for iOS and Android simultaneously.

duck monster
Dec 15, 2004

Does anyone know how Unity 3.5 flash target works? Did these crazy fuckers actually implement a dotnet/mono stack for flash or is there something whackier going on?

gonadic io
Feb 16, 2011

>>=
I'm currently making a tile-based game in Haskell and I was wondering what kind of data structure is recommended. The way I see it, I have a few options:
Arrays, something like:
code:
type Board = Array (Int,Int) Tile
data Tile = Tile Type [Object]
data Type = Grass | Water | ...
data Object = Man | Dog | ...
On one hand, this has O(1) element access and it's easy to get a tile's neighbours but searching for all tiles of a certain type are slow (unless I also store lists pointing to them?) and the size of a board is a (runtime) constant. Perhaps a list of such boards, something like Minecraft's chunks?

Or, I could do something like
code:
data Board = Board {water :: [Position], men :: [Position], ...}
type Position = (Int,Int)
But this seems fraught with issues, for example, asking "what is in a tile?" is a very expensive question.

I'm calling the two representations board-wise and piece-wise but what are they really called? Which is better? While I'm coding in Haskell, the question is pretty language neutral. Could I do some combination of the two, splitting static and dynamic properties?

Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."
I don't know much about Haskell, but whenever I run into a situation where two representations produce that kind of tradeoff, I encapsulate both data structures behind one set of accessors. As long as you hide the guts (or, in other situations, use guts that implement some sort of Observable system to notify consumers when they are mutated), it's a pretty clean approach.

That said, don't obsess over it unless you know it's actually a performance issue. Prototype with whichever approach is easiest, profile to find bottlenecks, tweak, profile and compare.

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!
When I worked on chess engines, the way both of the engines of that company did it was to have both representations. It depends on the game, obviously, but since chess 'thought' is both spatial and piece-relational, it makes sense to do it both ways - the additional expense of updating two things each time a piece moves is very small compared to the saving of 48+ squares you don't need to look at when you're finding which pieces can move in any given turn, and up to 32 pieces you don't need to look at for each square when you're checking if a path is clear.

So if you're doing AI for your game, I would suggest thinking about it like that - when you're considering a move-decision, what do you need to look at for each move, and how much of what you look at is going to be a waste of time each way? Chances are, storing it both ways is going to be the fastest option.

If you're not doing AI, chances are the way you choose to store it doesn't really matter, so just do it one way because it's easier. Spatially (grid of squares) is generally easiest unless you can have more than one thing in a square.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

duck monster posted:

Does anyone know how Unity 3.5 flash target works? Did these crazy fuckers actually implement a dotnet/mono stack for flash or is there something whackier going on?

They wrote a CIL to AS3 compiler, and then compile the AS3 with ASC. Unity is already restricted to a small subset of the .NET standard library. They wrote a bunch of replacements for these.

The CIL to AS3 compiler is in \Unity\Editor\Data\PlaybackEngines\flashsupport\BuildTools\cil2as\cil2as.exe.

The library is in \Unity\Editor\Data\PlaybackEngines\flashsupport\UnityPlayerNative.swc.

It would be nice if they open-sourced parts of this CLI support library and the CIL to AS3 compiler, but that won't happen.

OneEightHundred
Feb 28, 2008

Soon, we will be unstoppable!
I'm more curious to how UE3 got ported to Flash. Wouldn't doing something like that require reimplementing pretty much everything in AS, or is there a way to get Flash to run native components?

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

OneEightHundred posted:

I'm more curious to how UE3 got ported to Flash. Wouldn't doing something like that require reimplementing pretty much everything in AS, or is there a way to get Flash to run native components?

You can compile C/C++ to ActionScript Byte Code (ABC) with Alchemy, which uses LLVM to do the magic.

Duke of Straylight
Oct 22, 2008

by Y Kant Ozma Post

AlsoD posted:

I'm calling the two representations board-wise and piece-wise but what are they really called? Which is better? While I'm coding in Haskell, the question is pretty language neutral. Could I do some combination of the two, splitting static and dynamic properties?

Honestly I'd start with type board = Map Position Tile, mostly because the interface is nicer than that of Array. Though, I suppose it depends on the game whether O(1) access and O(n) update is better or worse than O(log n) access and update. Yes, updating immutable arrays is O(n) in the number of elements. There are DiffArrays which were supposed to be better, but they've always been practically slower for pretty much everything people have benchmarked them on.

If you want to actually get the game out, and don't see any particularly important reason why just having your data in a single access path wouldn't work, go for it without worrying about cleanliness. If you ever need to change it, you can refactor the types first and then follow the trail of type errors to everywhere that needs to be changed. The compiler is there to help you get away with doing the absolute least amount of work to write working code.

The reason to stick with one access path is that you have to add indirections or do extra work if you have multiple access paths. For instance, suppose you go with using both representations like roomforthetuna said, and suppose also that your ObjectS have, say, a health field. Let's say you're now implementing a hitTile :: DamageAmount -> Position -> GameState -> GameState, which reduces the health of all of the objects in a given tile. You're now going to have to through both the object list to find the objects in that tile and modify each object on the given tile of the board. Or you can have both of those structures just contain *references* to objects (Int is a perfectly good type for that job) and then have an additional Map Int Object in your game state so you only have to change things in one place when you are modifying an object. That, of course, comes with the cost of one more indirection, and some more complexity when adding or removing objects.

duck monster
Dec 15, 2004

Suspicious Dish posted:

They wrote a CIL to AS3 compiler, and then compile the AS3 with ASC. Unity is already restricted to a small subset of the .NET standard library. They wrote a bunch of replacements for these.

The CIL to AS3 compiler is in \Unity\Editor\Data\PlaybackEngines\flashsupport\BuildTools\cil2as\cil2as.exe.

The library is in \Unity\Editor\Data\PlaybackEngines\flashsupport\UnityPlayerNative.swc.

It would be nice if they open-sourced parts of this CLI support library and the CIL to AS3 compiler, but that won't happen.

Its very frigging clever. But yeah, I definately do keep banging my head on those missing bits of dot net.

Also, it would be nice if folks could just let flash die. I'd like to see a day when I could just uninstall that loving plugin, just so my goddamn browser would stop crashing once or twice a day.

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!
Are there threads somewhere for questions about 3D graphics packages, that would be a better place to ask than here? I'm not sure where to look.

I've gone through tutorials for the basics of Blender, because it can output files that Unity can use unlike Anim8or which is what I've been using before. I've got weight-painting and a couple of other ways of assigning bone weights down, but I can't figure out how to do it in a way that guarantees not missing any vertices. The best I've done is box-selecting zones in transparent mode and assigning them to 100% "vertex group X", but I still managed to miss 17 vertices out of 1200, according to Unity's FBX importer warning. And the results are fairly hideously deformed anyway.

Is there a tutorial somewhere on assigning bone weights reliably and getting decent results?

Edit: just in case anyone else comes by wondering, "bone heat" gets you a pretty decent start but is buggy as gently caress - I had to put on a subsurface modifier before it would even try to work, which I could then remove immediately afterwards and which logically shouldn't have any effect on the assigning of bone weights, and it still completely missed about 30 vertices. Then once you've got this basic "not too bad I suppose" set of weights, go into pose mode and wave some limbs around, looking for vertices that aren't following, then you can go into paint mode with those giant 'stalactites' of wrongness still poking out, and easily paint the stalactite tips onto whatever bone they're clearly supposed to be on. Apart from I was still left with two vertices that also refused to be painted, so I had to get them with a box-select from their unposed location, and assign them to a 'group' using a menu option. What a total clusterfuck.

roomforthetuna fucked around with this message at 06:37 on Jan 3, 2012

Orzo
Sep 3, 2004

IT! IT is confusing! Say your goddamn pronouns!
Maybe http://forums.somethingawful.com/showthread.php?threadid=2897255 ? I realize that's mostly programming questions but someone might still know.

Adbot
ADBOT LOVES YOU

Shameproof
Mar 23, 2011

I'm working on a 2D, but non-tile-based RTS/Sim game (a feel sort of like, say, Tropico or Starcraft Supreme Commander). What would be the best way to make the navigation graph for my AIs? A simple 8-way grid? A corner graph that updates with every new building?
I already set up a Quadtree for visibility purposes, but I doubt that using its centerpoints as pathfinding nodes is a very efficient idea.

Shameproof fucked around with this message at 12:07 on Jan 3, 2012

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