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
Mr.Hotkeys
Dec 27, 2008

you're just thinking too much

Orzo posted:

Yes, but you should be able to draw a SpriteFont by using a GraphicsDevice directly, which is what I'm guessing Mr.HotKeys uses to render all of his other graphics. I too have felt like inserting an arbitrary SpriteBatch just to draw fonts was kind of hacky, but as far as I know the API doesn't provide any other way.

Yeah this, pretty much. Especially since I have to call SpriteBatch.Begin() and SpriteBatch.End() every time I want to draw a string with my current code.

If it has to be that way then I guess it has to be that way, and I'll probably nuke it in the future and do my own thing, but it sucks there's no other way to do it.

Adbot
ADBOT LOVES YOU

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!

Morpheus posted:

So I've been wondering for a while now how to create modal windows, code and design wise. Nothing too complex, just a window that will halt process (unless I don't want it to) and return a value.
You can do this by instead of having your main loop, having what would normally be the main loop calls inside a function - that way you can call the "draw and deal with input" stuff from inside your modal-dialog function.

But it's really a lot more common and less error-prone for the answer to be "don't do that, instead have a stack of states, so when you create a modal dialog you put it on the top of the stack and have its processing dealt with by calls from the main loop."

(This is assuming you want your prompts to be done in the same DirectX style as the rest of a game - if you want it done windows style then you can make an actual modal dialog.)

Morpheus
Apr 18, 2008

My favourite little monsters

roomforthetuna posted:

You can do this by instead of having your main loop, having what would normally be the main loop calls inside a function - that way you can call the "draw and deal with input" stuff from inside your modal-dialog function.

But it's really a lot more common and less error-prone for the answer to be "don't do that, instead have a stack of states, so when you create a modal dialog you put it on the top of the stack and have its processing dealt with by calls from the main loop."

(This is assuming you want your prompts to be done in the same DirectX style as the rest of a game - if you want it done windows style then you can make an actual modal dialog.)

I do have a stack of states, that part I've got down (and oh ho ho you should've seen my code before I started using those) The only issue I have is having those states return a variable.

Someone else I know suggested using lambdas, which, except for stuff in a Schema class I took years ago, I know little about, especially in the arena of C#.

Mr.Hotkeys posted:

Yeah this, pretty much. Especially since I have to call SpriteBatch.Begin() and SpriteBatch.End() every time I want to draw a string with my current code.

If it has to be that way then I guess it has to be that way, and I'll probably nuke it in the future and do my own thing, but it sucks there's no other way to do it.

I'm probably the last person to ask for coding tips n tricks, but shouldn't Begin() and End() just be called once in a draw function? Or is this naive thinking on my part?

Cause I have this little fantasy adventure auto-simulator...thing that has text in the form of -5 DMG and +5 GOLD and what have you, and each of those are just individual objects that are generated and drawn as part of the draw loop.


Edit: Also having a GraphicsDispenser singleton that just doles out object references to various Sprites and SpriteFonts based on their name is just the best thing I have ever made for myself.

Morpheus fucked around with this message at 20:58 on Mar 31, 2011

Orzo
Sep 3, 2004

IT! IT is confusing! Say your goddamn pronouns!
Why is it a singleton?

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!

Morpheus posted:

I do have a stack of states, that part I've got down (and oh ho ho you should've seen my code before I started using those) The only issue I have is having those states return a variable.

Someone else I know suggested using lambdas, which, except for stuff in a Schema class I took years ago, I know little about, especially in the arena of C#.
Well, if it's done that way then you're not "returning" a variable, but you can pass one out. Depends on the goal though - a lot of cases you can do it as some sort of a message to the 'frame' below it on the stack. Sometimes you can just do whatever the effect is supposed to be directly, immediately before closing the frame, instead of passing a variable out at all. If not that, then you probably just need to have a function somewhere that the dialog calls when completed, with its 'return value' as a parameter.

Unless you mean you're still trying to make it a process-blocking function that actually returns a value, but if you're doing that you don't so much need a stack of states.

Basically, the answer to your original question is "there are two main approaches and neither of them really does what you want without a lot of annoying problems."

Morpheus
Apr 18, 2008

My favourite little monsters

Orzo posted:

Why is it a singleton?

The proper answer is likely because I designed it poorly, but my reasoning is that I only ever need one of it. I load it up with sprites and fonts when the program starts, and whenever I need a sprite or font, I simply tell the graphics dispenser "Get me a font with the name of CoolDude", and it passed me the Texture2D for CoolDude.jpg.

roomforthetuna posted:

Basically, the answer to your original question is "there are two main approaches and neither of them really does what you want without a lot of annoying problems."

Well...nuts. I guess I'll have to work with doing whatever it was going to do, immediately before the dialog frame is closed.

Edit: Or passing a delegate for the dialog to run before it closes. That might be good or a terrible trainwreck.

Morpheus fucked around with this message at 21:43 on Mar 31, 2011

Mr.Hotkeys
Dec 27, 2008

you're just thinking too much

Morpheus posted:

I'm probably the last person to ask for coding tips n tricks, but shouldn't Begin() and End() just be called once in a draw function? Or is this naive thinking on my part?

Not in this situation, it seems. As I understand it, SpriteBatch.Begin() makes a vertex buffer and sets it to the GraphicsDevice, but I'm making regular calls to GraphicsDevice.DrawUserIndexedPrmitives() to draw my sprite stuff and it seems that gets rid of any old info sent to the device (ie the buffer). So every time a string comes up, I call SpriteBatch.Begin() to remake that buffer, and then of course every time that happens I have to call SpriteBatch.End() so it doesn't poop itself the next time I call Begin().

In the batch I created, everything is seperated based on its type, ie line list, triangle list, or string, so I could create a more elegant solution I suppose to call Begin() as soon as it comes to the first string and End() next time it comes to the first nonstring, and I'll probably end up doing that (though I'm also sure I'm going to rip all this out and do my own text stuff down the road, just sick of working on it for now).

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!

Bob Morales posted:

Why don't you just use 'home garden designer 2011' or something? Shovelware easily found online or at Best Buy/Walmart.

quote:

Google Sketchup is free (for the basic version) and has a thing called 3D Warehouse where people can upload models of all kinds of stuff. A quick search for 'tree' returned 8950 free tree models. It can handle transparency and shadows. You can export the result as a COLLADA file if you want to import the model into something else.
The goal is to ultimately learn how to use Blender so I can DIY some 3d models and stuff for making toy game projects and such. I already use it for video editing on Linux. Oddly enough it worked the best and (most surprisingly) had the UI I could most understand.

...at least for video editing...

I was thinking the trees and stuff I intended to make I'd ultimately want to try to export and put into Irrlicht or something.

Anyways I did get a response back from blenderartists.org. I have yet to try it, but it's so unintuitive that it's bound to work. Did somebody say they cleaned up the UI? I may not be a modeler but I understand most all the 3d rendering nomenclature, yet how one has to approach stuff in it is so bizarre. On a different Blender topic, it's reliance on keeping everything as quads seems especially strange to me. Don't other modeling programs work fine with triangles?

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!
I just took a look at Google Sketchup, and it's remarkably easy to use for basic modelling. I may switch to using it for my initial modelling then convert the COLLADA output into my usual format before skeleton and skinning, rather than trying to model things in any other package. It's that much easier than anything else I've tried. I hope they add equally-better skeleton and skinning and animation capabilities to it later. I haven't really tried out its texture-wrapping yet either.

cultureulterior
Jan 27, 2004

Rocko Bonaparte posted:

On a different Blender topic, it's reliance on keeping everything as quads seems especially strange to me. Don't other modeling programs work fine with triangles?

I think quads are better for most subdivision surface algorithms.

Paniolo
Oct 9, 2007

Heads will roll.
I haven't used it myself, but I've had this sitting in my bookmarks for a time where I need to generate trees or foliage for a game:

http://ngplant.sourceforge.net/

quote:

ngPlant is a plant modeling software suite. Designers can use interactive tool to create 3D models of different plants and trees. Software developers can use 3D API-independent library to use generated plant models in their 3D applications, or to create plant modeling plugins for different 3D modeling tools.

Free and open source.

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!
I had thought sketchup ran in the browser so I was going to lament how Google can use a bastardized technology to create a 3d editing UI superior to client-side stuff, but then I saw it was a downloaded application. But it's still kind of telling that a company you wouldn't expect to care about 3d like that would make something so intuitive. Then again maybe one needs to be a little dissociated from it to make something more accessible; everybody else just gets used to the same crappy UIs.

quote:

I think quads are better for most subdivision surface algorithms.
Is this a general practice across 3d modelers then? It just surprises me after years of thinking in terms of triangles to then see an obsession over quads.

quote:

ngplant
That's pretty neat. For what I'm doing at this immediate time it might not be the most useful since for the backyard modeling I'm trying to get the big branches in pretty specific spots; we're interested in how it shades everything over the course of a day. But for creating game assets, having some kind of tool would be much more useful for cranking out a variety of trees.

Physical
Sep 26, 2007

by T. Finninho

Rocko Bonaparte posted:

Is this a general practice across 3d modelers then? It just surprises me after years of thinking in terms of triangles to then see an obsession over quads.

You know actually I think I did read something about how we wanted to turn our model into quads. I'm trying to think of what it is. But even a quad still gets broken down to 2 triangles unless you are doing GPU stuff I think.

fake edit: Ok I think it was the Maya help tutorials that talked about turning polys to quads, It was the helmet tutorial I think. Thats the only place I think I saw making quads was preferred. All my other stuff like to use vertices/index buffers.

Winkle-Daddy
Mar 10, 2007

Rocko Bonaparte posted:

Is this a general practice across 3d modelers then?

<DISCLAIMER>I am not a 3D modeler as anything more then a hobby</DISCLAIMER>

The reason most models start as quads is for doing things like adding detail to your model, it becomes very difficult to do things like loop cuts on triangles. Way back in the day, modelers were advised to model in tris and not quads because they needed to plan each vertex for performance reasons. (look at some Quake models) With the advent of Next Gen engines, this is no longer a requirement. A much better work flow is to be easier on the artist to make art better and faster (and have some of it reusable for cut scenes or what have you) then let the application divide all your quads into tris upon export.

Again, I'm not someone who does 3D modeling as anything more then a hobby, it's just what I've inferred from how engine/application specific modeling applications have changed over the course of time to adapt to increased memory allowances.

If you want to see this in action, download blender, go into edit mode, delete all the vertices and make a new model made of tris (ctrl+click to make a new vertex). Once you have a general shape, create faces out of them by selecting exactly 3 at a time and pressing the 'F' key to turn them into faces. Once you have a shape that is big enough to try this, try making a loop cut (ctrl+r) and watch how it tries to draw the loop cut line. Do the same thing with some of the included primitives and watch how more responsive the quads are to loop cuts versus the triangles.

Also take a look at which one would be easier to add detail to.

edit: I spell good. Also, what I say here is irrelevant to anyone working on games in a "modern"-ish engine on a modern-ish computer.

Winkle-Daddy fucked around with this message at 17:56 on Apr 4, 2011

Physical
Sep 26, 2007

by T. Finninho

Winkle-Daddy posted:

<DISCLAIMER>I am not a 3D modeler as anything more then a hobby</DISCLAIMER>

The reason most models start as quads is for doing things like adding detail to your model, it becomes very difficult to do things like loop cuts on triangles. Way back in the day, modelers were advised to model in tris and not quads because they needed to plan each vertex for performance reasons. (look at some Quake models) With the advent of Next Gen engines, this is no longer a requirement. A much better work flow is to be easier on the artist to make art better and faster (and have some of it reusable for cut scenes or what have you) then let the application divide all your quads into tris upon export.

Again, I'm not someone who does 3D modeling as anything more then a hobby, it's just what I've inferred from how engine/application specific modeling applications have changed over the course of time to adapt to increased memory allowances.

If you want to see this in action, download blender, go into edit mode, delete all the vertices and make a new model made of tris (ctrl+click to make a new vertex). Once you have a general shape, create faces out of them by selecting exactly 3 at a time and pressing the 'F' key to turn them into faces. Once you have a shape that is big enough to try this, try making a loop cut (ctrl+r) and watch how it tries to draw the loop cut line. Do the same thing with some of the included primitives and watch how more responsive the quads are to loop cuts versus the triangles.

Also take a look at which one would be easier to add detail to.

edit: I spell good. Also, what I say here is irrelevant to anyone working on games in a "modern"-ish engine on a modern-ish computer.

Can you post some screenshots depicting this please?

Goreld
May 8, 2002

"Identity Crisis" MurdererWild Guess Bizarro #1Bizarro"Me am first one I suspect!"

Winkle-Daddy posted:

The reason most models start as quads is for doing things like adding detail to your model, it becomes very difficult to do things like loop cuts on triangles. Way back in the day, modelers were advised to model in tris and not quads because they needed to plan each vertex for performance reasons. (look at some Quake models) With the advent of Next Gen engines, this is no longer a requirement. A much better work flow is to be easier on the artist to make art better and faster (and have some of it reusable for cut scenes or what have you) then let the application divide all your quads into tris upon export.

Well, cultureulterior had the primary reason correct.

cultureulterior posted:

I think quads are better for most subdivision surface algorithms.

The reason why quads are preferred for modeling has to do with subdivision. To be more precise, 4/4 meshes (4-valence vertices and 4-edge faces) are optimal for modeling, because you are guaranteed a C2 continuous surface when using Catmull-Clark subdivision. Anything else will result in extraordinary vertices, which can only be C1 continuous, which results in specular highlight problems. The technical reason for this has to do with the subdivision kernel of the Catmull-Clark algorithm itself. 4/4 meshes also play well with Doo-Sabin subdivision, because Doo-Sabin is the dual of Catmull Clark.

Unfortunately, it is impossible to have a completely 4/4 mesh if you have handles/high genus surfaces, so you're going to have issues if say, you model something with a bunch of tubes attached to it.

As for exporting a mesh, after you've performed all necessary subdivision operations (this will change for games in the future as GPU-driven algorithms are integrated into hardware - CG films will continue using Catmull-Clark as it's optimal), then triangular exports are still useful. The reason they're useful is not just for streaming triangles to hardware, but that many simplification algorithms for LOD use edge-collapses on triangular meshes. There are some brand-new algorithms for collapsing quad meshes, but they're a hell of a lot harder to deal with and there's only about 3 research papers on the subject so far.

There's also algorithms which rely on triangles for deformation (mean-value coordinates), but I won't get into that.


So pretty much in summary, if an artist isn't trying to make his meshes 4/4 ie. 4-valence verts/quads, then they're being baaaaaaad.

Winkle-Daddy
Mar 10, 2007

Physical posted:

Can you post some screenshots depicting this please?

Heh, I tried to do something quickly to illustrate this, however, blender would no longer let me do a loop cut on the copy of my model that I made faces with triangles on. The flow of the geometry was all kinds of hosed. It's really hard to take a screen shot of an interactive tool not working...especially in blender.

Though, while what I've described is a visual result; what Goreld said is better and more elegant anyway, so listen to him.

OneEightHundred
Feb 28, 2008

Soon, we will be unstoppable!

Goreld posted:

There's also algorithms which rely on triangles for deformation (mean-value coordinates), but I won't get into that.
Well, I think this would actually be a critical part of the question: Why is triangle-based subdivision "bad?"

As for GPU-driven algorithms, I'm pretty sure the vast majority of things looking to that are attempting to do texture-based subdivision and modification of the geometry, which isn't a drastic change from the existing paradigm where you export a low-res model and just use the high-res one for baking normal/height maps.

Goreld
May 8, 2002

"Identity Crisis" MurdererWild Guess Bizarro #1Bizarro"Me am first one I suspect!"

OneEightHundred posted:

Well, I think this would actually be a critical part of the question: Why is triangle-based subdivision "bad?"

As for GPU-driven algorithms, I'm pretty sure the vast majority of things looking to that are attempting to do texture-based subdivision and modification of the geometry, which isn't a drastic change from the existing paradigm where you export a low-res model and just use the high-res one for baking normal/height maps.

Loop subdivision isn't bad. However, there's certain parameterization issues that work better (or at least, are easier to deal with) for quad-meshes.

For one, when you're dealing with textures, if you have quads then you tend to get much less aliasing problems than with triangles, as we store our images in row/column formats. (this is of particular significance to the CG industry, where there's a bunch of texture synthesis techniques now for Renderman where you store a single texture for every face in a model)

Another reason is that Loop subdivision tends to shrink shapes a bit more than Catmull-Clark. Both methods produce nice, mathematically smooth results (discounting extraordinary vertices), but Catmull-Clark's results tend to look better.



edit: Yet another subtle difference which can pop up in odd places is the dual I mentioned before. That is, if you have a perfect tri mesh, its dual will be hexagons (6-valence tris into 3-valence hexes). This can cause... issues, which may be exotic but still - simpler is usually better! 4/4 meshes are much more elegant, because the dual remains 4/4. That way, if you develop some algorithm which works best on a 4/4 mesh, and combine it with an algorithm that uses a dual operation, then you're not going to run into issues. Having that kind of symmetry just makes stuff more robust for free.

edit 2: Of course, the flipside of that is that calculating surface Laplacians and/or cotan weights are much simpler with tri-meshes.

Goreld fucked around with this message at 21:09 on Apr 5, 2011

Winkle-Daddy
Mar 10, 2007
Anyone using Panda3D?

I've started looking into it but the documentation on their site is both a blessing and a curse. Every little thing is documented, but not in a way that is helpful for someone new trying to start out with it.

I've found this resource:
http://www.mygamefast.com/

I am currently considering picking myself up a copy of http://www.packtpub.com/panda3d-16-game-engine-beginners-guide/book

Anyone use that/have any impressions? Anyone have any other resources for building a game completely with Panda3D? I can do parts, but there is also quite a bit of gaps in my knowledge of the engine. I'm trying to get considerably better at Python which should help a lot but hope someone else has found some better resources.

Hughlander
May 11, 2005

Winkle-Daddy posted:

Anyone using Panda3D?

I've started looking into it but the documentation on their site is both a blessing and a curse. Every little thing is documented, but not in a way that is helpful for someone new trying to start out with it.

I've found this resource:
http://www.mygamefast.com/

I am currently considering picking myself up a copy of http://www.packtpub.com/panda3d-16-game-engine-beginners-guide/book

Anyone use that/have any impressions? Anyone have any other resources for building a game completely with Panda3D? I can do parts, but there is also quite a bit of gaps in my knowledge of the engine. I'm trying to get considerably better at Python which should help a lot but hope someone else has found some better resources.

I worked on it professionally a few years ago, at that time it wasn't well supported outside of Disney and CMU, not sure if that changed, from what I can tell PyGame is the hotness for Python game development, but that's not to say that it's any better or worse than Panda, just a bigger support base from what I've seen.

Have you seen http://inventwithpython.com/ ? It's a blog/book about PyGame/Python.

Winkle-Daddy
Mar 10, 2007

Hughlander posted:

I worked on it professionally a few years ago, at that time it wasn't well supported outside of Disney and CMU, not sure if that changed, from what I can tell PyGame is the hotness for Python game development, but that's not to say that it's any better or worse than Panda, just a bigger support base from what I've seen.

Have you seen http://inventwithpython.com/ ? It's a blog/book about PyGame/Python.

Thanks for your input. I was drawn to Panda3D because it was a full 3D game engine with a lot of the features that are Unity3D pro features (shaders and such). I looked at Ogre3D as well, but am sort of put off by C++ at this point in my programming career; or at least using it in a game. So, the power of Unity3D with the easy of Python seemed like a decent idea to me.

I am a better 3D modeler then I am python programmer and when I looked at a lot of the pygame examples, it seemed primarily 2D, though I'll look into it further since you suggested it. Thanks for that!

Can you elaborate on how scalable Panda3D was in your professional experience? So far I've really enjoyed messing around with it; but traversing the scene graph and working with instancing seems like it is handled somewhat poorly and can get out of hand very quickly. Confirm/Deny?

e: VVV I work in Perl at work...Python is a nice change of pace that keeps things fun.

Winkle-Daddy fucked around with this message at 02:51 on Apr 6, 2011

ambushsabre
Sep 1, 2009

It's...it's not shutting down!
Can't you code with python *in* Unity3d? I think that if you have the drive to learn it doesn't really get a whole lot better then Unity, unless you want to work at the graphics level which would be something like Ogre, which will take you a long time. Python may seem easy, but it can be a huge pain in the rear end because it's not strict at all. Whatever floats your boat man.

brian
Sep 11, 2001
I obtained this title through beard tax.

Yeah you can use Boo with Unity3D which is just a .NET enabled python, I mean it's nowhere near as good as just using C# which is a much nicer language to use, especially with the MonoDevelop debugging and autocomplete stuff in the Unity version of MonoDevelop.

Hughlander
May 11, 2005

Winkle-Daddy posted:

Can you elaborate on how scalable Panda3D was in your professional experience? So far I've really enjoyed messing around with it; but traversing the scene graph and working with instancing seems like it is handled somewhat poorly and can get out of hand very quickly. Confirm/Deny?

Not really, all of my experience is now 5 years out of date, and the version that supported shaders had just come out. I remember that in general it was more academic than practical despite shipping a game with it. IE: Features were written for completeness but never actually used and as such didn't work (as expected or at all.) I haven't kept up with development since early 2006 though.

Also don't take pygame as a recommendation, just as an alternative, I know it exists and I follow that blog, but mostly just because I like reading a lot of different things, I've never even downloaded pygame :)

Winkle-Daddy
Mar 10, 2007

Hughlander posted:

Not really, all of my experience is now 5 years out of date, and the version that supported shaders had just come out. I remember that in general it was more academic than practical despite shipping a game with it. IE: Features were written for completeness but never actually used and as such didn't work (as expected or at all.) I haven't kept up with development since early 2006 though.

Also don't take pygame as a recommendation, just as an alternative, I know it exists and I follow that blog, but mostly just because I like reading a lot of different things, I've never even downloaded pygame :)

Panda has such a small following it's really cool to hear from anyone who has used it. If you used it with any level of competency in the past, you should check it out again and see if it's improved much; I'd love to know.

I did find out the book I was thinking about picking up was available through Safari Books Online, so I decided I'd start going through it. I'll report back at some point on how good of a resource it is but in my skimming it looks extremely complete. The only main challenge to me using Panda3D right now is that the chicken exporter for Blender doesn't support anything in the 2.5 series. Though, I've had to start converting some Perl scripts to Python at work so I may try my hand and writing an updated Chicken exporter for Blender.

If anyone is interested in trying something new, cross platform and open source check it out!

main site:
http://panda3d.org

good online tutorial for getting your feet wet:
http://www.mygamefast.com/

That tutorial page doesn't require you to build many of your own resources so it's a great way to just jump into the code and see if you enjoy working with the engine.

There are 3DS Max and Maya .egg exporters available that seem to work better then the ones available for Blender. You can also choose to code in Python or C++

While not nearly as rich of a development experience as Unity, nor a very active community, it's still worth a look. I've played around with quite a few engines and for whatever reason I personally find this one to be the most 'fun.'

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!
For anybody that's good with programming and have the general idea of game engines down, but are still daunted by the whole thing, I'd recommend playing with a modeler for a little bit. My big problem with games has been imagining the whole "meshes bumping into meshes and interacting with other meshes" that makes up a lot of the 3d side of things that seems too daunting to me.

To that end, I was wondering how pervasive pixel shaders are these days for replacements for textures? If that's not how they're being used then how do they get to be such a hot item? I can understand things like normal mapping and cell shading, but outside of that are they just being used for the shiny?

What got me thinking about this was all the stuff in Blender for generating materials in Blender procedurally. I wondered if instead of dealing with a bunch of wood textures if people instead are just applying a wood effect shader. Stuff like that.

gwar3k1
Jan 10, 2005

Someday soon
I've started following a guide to learn 2D game development and I've followed it to the letter aside from using XNA 4 when the book is targeting 3. I've spent ages Googling this problem and the only solution I can find is what I'm doing anyway which is infuriating because this is like the Hello World of the book and it refuses to work.

I'm using the following code and getting a ContentLoadException was unhandled error: File not found.

code:
  Content.RootDirectory = "Content";
...
  Content.Load<Texture2D>("p1")
p1 is definitely the asset name and p1.png exists in the folder Content is pointing to (C:\Users\gwar3k1\Documents\Visual Studio 2010\Projects\XNATutorial1\XNATutorial1\XNATutorial1Content\).

Any suggestions?

Winkle-Daddy
Mar 10, 2007

Rocko Bonaparte posted:

To that end, I was wondering how pervasive pixel shaders are these days for replacements for textures? If that's not how they're being used then how do they get to be such a hot item? I can understand things like normal mapping and cell shading, but outside of that are they just being used for the shiny?

What got me thinking about this was all the stuff in Blender for generating materials in Blender procedurally. I wondered if instead of dealing with a bunch of wood textures if people instead are just applying a wood effect shader. Stuff like that.

I can't speak to pro/proprietary engines; however, most of the engines someone will be using for free/cheap are going to be 99% UV mapped textures with shaders being used for effects. For example:

http://www.panda3d.org/manual/index.php/Sample_Programs:_Glow_Filter

Shader being used in conjunction with your standard diffuse map.

Paniolo
Oct 9, 2007

Heads will roll.
http://www.youtube.com/watch?v=QZxRauOpfwo

I've been working on a voxel-based procedural level generator, loosely inspired by this article from GPU Gems 3:

http://http.developer.nvidia.com/GPUGems3/gpugems3_ch01.html

While they do everything on the GPU and use perlin noise as a density function, I'm doing it on the CPU and sampling a voxel map + filtering for the density function. Eventually I will add noise to displace the vertices slightly, so the edges aren't quite so straight.

The voxel map generation algorithm is stupidly simple. Eventually I want to feed it data from a roguelike-style dungeon generator. My long term goal is to see how far I can push the kind of procedural level generation you see with roguelikes into the realm of hi-fi graphics.

OneEightHundred
Feb 28, 2008

Soon, we will be unstoppable!

Rocko Bonaparte posted:

To that end, I was wondering how pervasive pixel shaders are these days for replacements for textures?
Not at all because all they get as input are textures and interpolated values from the vertices. Almost any procedural generation you'd want to do in a shader is much more expensive than a texture lookup. You could argue that a lot of pixel shaders are pseudo-procedural in the sense that they have massive influence over what the surface looks like, but they're still mostly driven by input texture lookups.

quote:

If that's not how they're being used then how do they get to be such a hot item?
Because doing anything without them involves shoehorning what you want to do into an extremely inflexible and in-order set of fixed effects.

They're not just "for shiny", they're for practically everything. Any even remotely interesting way of combining texture inputs (i.e. gloss LUTs, directional lightmaps, relief mapping, all sorts of exotic texture encodings) is made worlds easier by them, and everything I just mentioned is as useful on a boring brick wall as it is on face-melting HDRI glitter explosions.

OneEightHundred fucked around with this message at 23:05 on Apr 6, 2011

Gerblyn
Apr 4, 2007

"TO BATTLE!"
Fun Shoe

Rocko Bonaparte posted:

My big problem with games has been imagining the whole "meshes bumping into meshes and interacting with other meshes" that makes up a lot of the 3d side of things that seems too daunting to me.

Are you talking about collision detection here? I'm a bit confused how you got from this sentence to questions about pixel shaders...

Mr.Hotkeys
Dec 27, 2008

you're just thinking too much

gwar3k1 posted:

I've started following a guide to learn 2D game development and I've followed it to the letter aside from using XNA 4 when the book is targeting 3. I've spent ages Googling this problem and the only solution I can find is what I'm doing anyway which is infuriating because this is like the Hello World of the book and it refuses to work.

I'm using the following code and getting a ContentLoadException was unhandled error: File not found.

code:
  Content.RootDirectory = "Content";
...
  Content.Load<Texture2D>("p1")
p1 is definitely the asset name and p1.png exists in the folder Content is pointing to (C:\Users\gwar3k1\Documents\Visual Studio 2010\Projects\XNATutorial1\XNATutorial1\XNATutorial1Content\).

Any suggestions?

Did you add it, in Visual Studio, to your content project? If VS doesn't know it's there, the content importer won't compile it into a texture and your program won't be able to find it. XNA can't use raw PNG files as textures, they have to be run through the content importer first.

Gough Suppressant
Nov 14, 2008
You can load images from a file in XNA, it's just done a little differently, I do it in my current project so my artist can just have the compiled game + texture folders to mess around in rather than having to have VS installed.

I'm guessing though due to the fact that he specified a name for the texture as opposed to a filename, he almost certainly has added it to the project in VS.

edit: is there any chance you're doing the Content.Load call in either the constructor or Initialize method? Because from memory if you call Content.Load before the game hits the LoadContent() function it spazzes as content isn't fully initialized yet.

Gough Suppressant fucked around with this message at 02:06 on Apr 7, 2011

pastorrich
Jun 7, 2008

Keep on truckin' like a novacane hurricane
Sorry to pop in out of nowhere but:

I have some sort of a problem. I finally found what I want to do in life, and I am very happy about it. I want to have a career as a game designer and design all sorts of games. This is what I want to do, no doubt, it's a go, get on with it. I also heard that it's an industry where you can start in QA and work your way up, but I have also heard the exact opposite, which is why I want to have some sort of a formation to back up my creativity and dedication.

I live in montreal, so there's plenty of jobs in the game industry, and I found a cheap, well rated 1.5 year degree in a college here. The thing is, I can't draw properly (I only doodle, but in a rather original way), I don't know any code and I've never used any game making programs before. I do, however, work in QA at the moment, so I am familiar with bugs and whatnot and I know what collision and LOD means. I downloaded the Unreal Engine and watched a few tutorial videos, but building a whole unreal level seems like a long task and I don't have much time.

On to my main problem: I have until May 13th to submit a portfolio for evaluation. I have nothing prepared, because until this week they didn't announce anything and I figured the program would start somewhere in 2012 and I had plenty of time to get to building a level. Here are the portfolio requirements (I need to pick a minimum of 3, and they are in order of preference)

1. An original game level design, e.g. Half-Life II MOD, Portal MOD, Team Fortress MOD, Unreal Tournament MOD, etc.

2. A two or three page critical analysis of a game level.

3. An original concept for a level.

4. An original computer-based game using tools such as Flash, Gamemaker, RPG maker, etc.

5. An original non-digital game, e.g., table top game, board game, card game, puzzle game, etc. Provide a document with overview, photos and rules.

6. An original concept for a game.

Now, I could go with 2-3-6 and I would not have to build anything, but I know I'm creative, I just don't have the skills to go with at the moment. I want to get into the program, so I need to showcase some form of content. I would really like to do 2-3-6 and one other (not 5).

So here is what I am asking: Does anyone have experience with gamemaker, flash, RPG maker, or MOD making? Which one is the most user-friendly and quick to learn? Any templates on level and game concepts? Things I should know about game or level conception? What does one look for in a portfolio when hiring someone? Can this be done in a month? I work full time but I still have lots of free time. Please goons, get me into this program

thanks alot for the advice and the game, this is very inspiring.
vvvvvv

pastorrich fucked around with this message at 03:09 on Apr 7, 2011

The Cheshire Cat
Jun 10, 2008

Fun Shoe
In terms of least to most technical: RPG Maker, Game Maker, Flash/Modding (this one depends on what you're modding). Personally I would avoid RPG maker since it's obviously extremely limited in what it's able to do. Game Maker would probably be your best option. You don't really need to know any code to make something basic (though it helps to learn a bit). Game mods require either scripting ability or artistic ability, depending on what you're trying to do, and both can be pretty difficult if you don't have any practice so I wouldn't do that as a first attempt.

What you can do in a month depends entirely on how driven you are and how well defined your concept is. It's best not to attempt anything too complicated in a month; a good concept would be a puzzle game with a simple ruleset, which would take very little time to just get working in Game Maker, and then you can spend the rest of your time making levels for it. A good example of the kind of thing I mean is Tealu and Orangey, which was made by a goon as a portfolio piece. It was done in flash but the same thing would work in GM - it takes a really simple concept and just runs with it to come up with clever ways to play with the rules.

PDP-1
Oct 12, 2004

It's a beautiful day in the neighborhood.

Paniolo posted:

http://www.youtube.com/watch?v=QZxRauOpfwo

I've been working on a voxel-based procedural level generator, loosely inspired by this article from GPU Gems 3:

http://http.developer.nvidia.com/GPUGems3/gpugems3_ch01.html

While they do everything on the GPU and use perlin noise as a density function, I'm doing it on the CPU and sampling a voxel map + filtering for the density function. Eventually I will add noise to displace the vertices slightly, so the edges aren't quite so straight.

The voxel map generation algorithm is stupidly simple. Eventually I want to feed it data from a roguelike-style dungeon generator. My long term goal is to see how far I can push the kind of procedural level generation you see with roguelikes into the realm of hi-fi graphics.

This looks cool as heck so far, nice job.

Merging a rogue-like generator into a voxel engine seems totally possible - just generate the rogue-like map as areas with zero density, blur the edges a bit so they fade from zero to one and then multiply it by your Perlin density function.

The only tricky bit would be figuring out how to do path finding on a randomly-generated map in some efficient way. I suppose you could derive a set of A* nodes from the density function pretty easily (hollow = passable) but you'd have to find the 'floor' of each hollow section and then stitch the maps of generated blocks together and oh god that does not sound like a fun evening of hobby programming at all.

Anyway, keep posting your results - this looks like a neat project.

pastorrich posted:

portfolio stuff
If you haven't done so already, check out the Game Jobs Megathread. It's full of actual game dev professionals who could give you some good pointers and portfolio critiques. Just be warned - they will praise you to the high heavens if your work is good but they will also rip you several new ones if its not.

Vino
Aug 11, 2010

pastorrich posted:

Now, I could go with 2-3-6 and I would not have to build anything

Err - wrong. You need some of 1-4-5 (in fact I think you need mostly 1-4-5) or you'll never get anywhere. The game industry doesn't hire designers without skills in other places. You need to get cracking on learning some art or programming (or both!) if this is what you want to do.

Also yeah check out the game jobs thread, there's lots of great people in there.

brian
Sep 11, 2001
I obtained this title through beard tax.

Vino posted:

Err - wrong. You need some of 1-4-5 (in fact I think you need mostly 1-4-5) or you'll never get anywhere. The game industry doesn't hire designers without skills in other places. You need to get cracking on learning some art or programming (or both!) if this is what you want to do.

Also yeah check out the game jobs thread, there's lots of great people in there.

It's to get on the course not to get a job, there's no junior designer job that would ever present a list and say 'please show 3 of the 6 things here'. Presumably they teach you an actual skill on the course although it seems somewhat unlikely given that it's for game design and is so short.

Adbot
ADBOT LOVES YOU

Paniolo
Oct 9, 2007

Heads will roll.

PDP-1 posted:

The only tricky bit would be figuring out how to do path finding on a randomly-generated map in some efficient way. I suppose you could derive a set of A* nodes from the density function pretty easily (hollow = passable) but you'd have to find the 'floor' of each hollow section and then stitch the maps of generated blocks together and oh god that does not sound like a fun evening of hobby programming at all.

Anyway, keep posting your results - this looks like a neat project.

Thanks! I don't expect pathfinding to be a problem since the geometry generation is set up such that empty cells are guaranteed to not have any geometry in them, and solid cells will be sparsely to densely filled with geometry based on the density of the voxel and its neighbors. Each voxel is rather large (the maximum floor to ceiling distance in the video is only 3 voxels), so I just need to treat every empty cell as completely pathable and every solid cell as completely blocked. That should make course pathfinding and collision detection trivial.

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