|
Shinx posted:What is the general idea with regards to learning programming for gaming? Should I take CS at a college/university or should I just self-teach a programming language? Just a note that computer science is to programming as biology is to dressing wounds.
|
# ? Jan 7, 2012 22:23 |
|
|
# ? Jun 9, 2024 16:31 |
|
Force Quilt posted:Just a note that computer science is to programming as biology is to dressing wounds. That's not entirely fair. While that might arguably be fair for Comp Sci as a discipline, it's certainly not the case for a Comp Sci degree. Most CS degrees do teach programming and software engineering in addition to the academic stuff.
|
# ? Jan 7, 2012 23:09 |
|
Suspicious Dish posted:Flash is the best vector art modeller I've used. Once you get used to it and the "cookie cutter" effect, it feels more like manipulating clay than dealing with Bezier curves. Besides that, Photoshop is the known standard and works tremendously well. The real answer for a 2D spriting tool, when I asked about ten pages back, is "a lot of practice and, even when you have a lot of practice, still a lot of time." There's no tool that makes it fast and easy. Just in case you were hoping for a magic bullet like I was.
|
# ? Jan 7, 2012 23:29 |
|
I've been working on a Zelda-like dungeon adventure game for my Forth VM, and I wanted to show off the scripting system. Here we have a room containing an empty chest. If the player fills it with gold, the chest will disappear and monsters will spawn, locking the doors until all enemies have been defeated. When we visit the room later, the chest will stay gone and no enemies will spawn. Here's the setup routine for that room: code:
I really like working with Forth because it scratches my "low-level coding" itch and is equally suitable for writing game engines or building up these sorts of high-level abstractions. What kinds of approaches do you folks typically use for wiring up this sort of one-off logic, aside from Lua? Internet Janitor fucked around with this message at 00:04 on Jan 8, 2012 |
# ? Jan 7, 2012 23:53 |
|
Internet Janitor posted:What kinds of approaches do you folks typically use for wiring up this sort of one-off logic, aside from Lua? ... but, we also tend to use UDK or Unity (and for the next Unity game - I'm insisting on uScript), so that does pattern our behaviors a bit. If I had to write an engine from bare metal and didn't have time for a visual system, I'd typically just stop at Lua and cross my fingers.
|
# ? Jan 8, 2012 00:05 |
|
Internet Janitor posted:I'd love to see you write more on Forth (wasn't there a thread somewhere?). To me, having learned programming through Java, Forth is like reading an alien language; Completely impossible, yet intriguing! With the VM and now this, your approach to Forth is looking really interesting to me. I've dabbled in assembly so I can understand that "low-level coding" itch!
|
# ? Jan 8, 2012 05:58 |
|
Your Computer: thanks! I started a thread about half a year ago when I was first getting into the language, but there was never much interest. I don't usually get a lot of feedback when I post my code here so I assumed it wasn't all that intriguing. I'll definitely be putting my adventure game on github when I've worked out a few bugs and made more progress on level design. In the meantime all my existing code for the VM project is available: The MakoVM repository A Crash Course in Mako and my Forth dialect If you're interested in pure CS wankery here's an extremely simple garbage collector and a set of Lisp-style cons-pair list manipulation operations, all in Forth: Pair.fs code:
Internet Janitor fucked around with this message at 06:23 on Jan 8, 2012 |
# ? Jan 8, 2012 06:20 |
|
Internet Janitor posted:Your Computer: thanks! I started a thread about half a year ago when I was first getting into the language, but there was never much interest. I don't usually get a lot of feedback when I post my code here so I assumed it wasn't all that intriguing. For what it's worth, I enjoy seeing your posts in this forum. You're getting a lot of mileage from your project, and it's neat seeing your completed games. I just don't comment because Forth is totally outside my understanding and I don't really have anything useful to say
|
# ? Jan 8, 2012 10:58 |
|
Pfhreak posted:That's not entirely fair. While that might arguably be fair for Comp Sci as a discipline, it's certainly not the case for a Comp Sci degree. Most CS degrees do teach programming and software engineering in addition to the academic stuff. I agree. IMHO it's better to learn to program than learn a programming language. My point is that if one wants to learn to program, it's a good idea to just start programming, school or not. Theory isn't much use without practice, and IMHO too much theory leads to bad programmers who are more concerned with correctness and paradigms and adhering to dogmas than actually getting stuff done, and as an indie developer, getting stuff done is more important than doing it right. (Though doing it right is also important, it's just not as important.)
|
# ? Jan 8, 2012 18:20 |
|
Internet Janitor posted:Here's the setup routine for that room: This looks like a random permutation of the tokens of a normal program.
|
# ? Jan 9, 2012 01:43 |
|
Forth is postfix? edit: Here's some C-like code that expresses basically the same thing as that script: code:
Internet Janitor fucked around with this message at 02:25 on Jan 9, 2012 |
# ? Jan 9, 2012 02:01 |
|
I'm sure it makes perfect sense if you know the language, I've just never seen anything like it before.
|
# ? Jan 9, 2012 02:53 |
|
Forth is cool, keep posting about it. Also highly recommended: Factor.
|
# ? Jan 9, 2012 03:12 |
|
I'm a huge fan of what Blizzard did in WC3 and SC2 where they had a graphical editor that was ultimately capable of laying down most of the scripting facilities through the editor GUI. Stuff like that has been generally easy for non-programmers to pick up. Ultimately though, being able to do something like that consumes a lot of time, and if you don't have the programming resources available, then you're probably better off using a scripting language. Lua has a major advantage in that you can easily feed it code bits to run to force things to happen in the world or debug.
|
# ? Jan 9, 2012 03:12 |
|
redleader posted:For what it's worth, I enjoy seeing your posts in this forum. You're getting a lot of mileage from your project, and it's neat seeing your completed games. I just don't comment because Forth is totally outside my understanding and I don't really have anything useful to say Seconding this - your stuff is cool as heck Internet Janitor and I hope you don't take people's occasional relative silence to indicate a lack of interest. Forth is just so unlike the C/C++/C#/Java type languages many of us are familiar with that it's hard to come up with any kind of intelligent comments or questions. Mostly I just go all that you managed to not only write your own VM, but you pushed it to the point that you can write graphics-based games in it. Goddamn dude, nice work.
|
# ? Jan 9, 2012 05:12 |
|
Gordon Cole posted:I'm sure it makes perfect sense if you know the language, I've just never seen anything like it before. Forth is like if someone invented the most simplest , powerful and logically coherent verbal language ever, but it was so different to the way normal humans spoke that if you heard it, it sounded like TV white noise. Forth in a sentence: Everything is stacks, you put things on a stack then you do something to the stack and put the result on the stack. Thats it, forth explained. I should also add, that its ridiculously meta-programming-ish. Out of the box it doesn't even understand variables, you need to teach it the concept of variables, usually with a line of code. But then you can add all sorts of constructs to it like Object oritentation and it becomes more and more powerful and expressive as it goes on. And you name it, you can implement the fucker in forth.Te end result is that its the ultimate toaster-coding language, it can be assembly-language close to the metal, but you can implement some serioualy high leve l constructs in it. I remember in the 90s being utterly mystified why Unix was implemented in C rather than forth. I guess lisp guys wondered the same (although unlike lisp, forth can be extremely fast, not that it really matters with modern lisp compiler design, but it sure did used to matter!) The details are a bit more complex, but like lisp its all about taking a loving simple concept and using that concept to expand into something rich and powerful. Also Forth is one of the simplest languages on the planet to write a compiler for, because its such an inherently simple language. My first forth compiler was about 10 pages of qbasic, that compiled it to Z80 code, sometime in the 90s. Someone who is not me should do a 'Lets teach ourselves forth" thread. Its a language that when the penny drops as to how to "think" in forth, it'll cause you to look at the way you think about code in a totally new way, and your hair will blow back just a little bit. "Its like Everything is reverse polish now, like out there is the true world, and in here is the dream". Forth won't let you gently caress a giant blue chick though. duck monster fucked around with this message at 12:20 on Jan 9, 2012 |
# ? Jan 9, 2012 12:10 |
|
And additionally, everybody should play around with a stack-based VM one of these days and write some code in it. Decompile some .NET code to CIL and look at the assembly dump and understand it. After a while you can just write algorithms in bytecode and compile code in your head. (OK, that link is ActionScript Byte Code, not CIL, but they're quite similar)
|
# ? Jan 9, 2012 21:14 |
|
Suspicious Dish posted:And additionally, everybody should play around with a stack-based VM one of these days and write some code in it. Decompile some .NET code to CIL and look at the assembly dump and understand it. I'd like to know more about this. Where can I go for more information?
|
# ? Jan 10, 2012 00:20 |
|
If this is plug-your-VM day then okay, I'm working on what is basically a C# ripoff combination resource manager/runtime focused on serialization, predictable execution, and speed. It has some weird quirks. Basically I'm trying to get most of the advantages of how Unreal handles data without the disadvantage of UnrealScript being kind of hosed up, and being fast enough to handle important stuff like rendering code. It was expanded to have silly stuff like native code compilation and thread serialization, which are ironically not mutually exclusive. The VM has 33 opcodes and otherwise makes extreme abuse of intrinsics. It's not quite ready for public consumption yet, but it is being used in my current project's tools! OneEightHundred fucked around with this message at 00:54 on Jan 10, 2012 |
# ? Jan 10, 2012 00:43 |
|
Heh, little tidbit for C# component-composition-based engine. I'm learning Unity3d and it taught me that: public T GetComponent<T>() where T : IPart is a heck of a lot cleaner in practice than public IPart GetComponent( string Name )
|
# ? Jan 10, 2012 01:35 |
|
TJChap2840 posted:I'd like to know more about this. Where can I go for more information? What do you want to understand? For C#, ildasm is the standard disassembler. If you're not on Windows, use monodis there. I'm more familiar with the ActionScript Byte Code (ABC) used by Flash, so let's compile a simple function to that: code:
code:
{} is the stack, [] is the locals. code:
|
# ? Jan 10, 2012 02:27 |
|
Unormal posted:Heh, little tidbit for C# component-composition-based engine. I'm learning Unity3d and it taught me that: I've been running my rear end into the ground doing the messy way, basically because I want to be able to smash away at a lot of the game coding in Python itself. So I can't rely on static types at all. Otherwise templates--or at least generics as done here--makes a lot more sense.
|
# ? Jan 10, 2012 07:11 |
|
loving unity. I've been coding away at an OcTree boxely voxely type thing , mainly because it seems like an interesting thing to do, and I decided to use Boo because it looks a bit like python, and python is cool yeah. gently caress! Boo is Mostly like python except it really loving isn't, its sort of C# with crazy rear end syntactic sugar and duck typing usually but not always. The probelem is, boo is just poorly documented. The boo language has very poor documentation, and theres even less about how to use it in Unity, although I've pretty much been able to infer that part from reading the C#. I spent half a day banging my head on the wall trying to figure out how to pass arrays to a loving function. Something so god drat basic , but yet its not documented anywhere. Turns out its just def blah (something as (type)): right cool. Next cab off the rank. Appending to an array. *digs through manual* Oh This loving thing. Unity you cunts, just give us ironpython for gently caress sake.
|
# ? Jan 10, 2012 17:45 |
|
I know next to nothing about Unity but from the one or two times I've bothered poke around at it I remember seeing warnings against using Boo. The explanation is that (a) it's not really Python and the small differences will drive Python people nuts, and (b) it's not supported on some platforms (iOS?). But hey, since you're working on a boxely voxely type thing let me ask you this - does Unity support direct creation and manipulation of vertex/index arrays? Can you give the engine a list of vertex/index data and a custom shader and tell it to go draw the mesh? If not, what are you using to draw your voxels? e: Can anyone recommend a book on Unity development that is written for programmers? Judging by some of the Amazon preview pages it looks like many of the books out there are written for Idea Guys and don't actually go into much depth on the technical/scripting discussions. PDP-1 fucked around with this message at 19:24 on Jan 10, 2012 |
# ? Jan 10, 2012 18:11 |
|
I always have this problem when I touch Unity shaders... Can anyone think of why this wouldn't properly set the tint on all associated sprites? code:
I use a variant of the above code to fade a screen-sized polygon out as well, and that works fine, so... weird. Ideas are welcome. I think I might be running afoul of the "materials" vs "material" difference, where changing values on the "materials" member never seemed to work in the past, but maybe now I have to, or... bluh. This part of Unity is documented incredibly poorly. Bonus question: what is the variable type on var meshRenderers, as expressed in JavaScript? I know how it would look in C#, but I've never gotten an equivalent var type in JScript that works (and I hate leaving it dynamically typed). Shalinor fucked around with this message at 19:26 on Jan 10, 2012 |
# ? Jan 10, 2012 19:24 |
|
PDP-1 posted:But hey, since you're working on a boxely voxely type thing let me ask you this - does Unity support direct creation and manipulation of vertex/index arrays? Can you give the engine a list of vertex/index data and a custom shader and tell it to go draw the mesh? If not, what are you using to draw your voxels? But I think Unity is probably not great for voxeling, because you'd either be making a collisionbox component for every solid voxel, which would be hugely inefficient spacewise, or rolling your own stuff for the collisions and maybe ending up not being able to use Unity's physics at all. And once you're not using the physics, and rolling your own vertex buffers, and rolling your own shaders, what's Unity even doing for you any more? Might as well just be using SDL! (Alternatively you could have an update function that places colliders for all the voxels that are near something that might collide with them, each frame, which would probably work okay, but it's still quite a mess compared to implementing something more dedicated to voxeling.)
|
# ? Jan 10, 2012 19:32 |
|
quote:I know it's hitting every single object in the hierarchy, but no color change occurs. If I manually change the tint color on the material in my assets view (pre-execution), it works fine, so the shader itself is properly taking the tint value. I'm just not having any luck changing it run-time. Or, more easily, renderer.materials[0].color=Color.green. quote:Bonus question: what is the variable type on var meshRenderers, as expressed in JavaScript? I know how it would look in C#, but I've never gotten an equivalent var type in JScript that works (and I hate leaving it dynamically typed). Edit: that's actually what they have in the script reference page for GetComponentsInChildren, so it should be fine (though they used HingeJoint[]). roomforthetuna fucked around with this message at 19:52 on Jan 10, 2012 |
# ? Jan 10, 2012 19:49 |
|
roomforthetuna posted:var mr : MeshRenderer[] = whatever.GetComponentsInChildren(MeshRenderer); seems to work, though I can't check the results easily because my MeshRenderer I'm playing with for this is on the top object. Specifically: var meshRenderers : MeshRenderer[] = this.gameObject.GetComponentsInChildren(MeshRenderer); EDIT: And similarly, no dice on the materials[0]. I even tried: code:
How bizarre. I've even temporarily got this running in Update, so it should be spamming it every single frame. Time to poke through my other components... I suspect the way my AnimatedSprite class works may be interfering with me here. Dynamically generated anything in Unity just seems to confuse it, it's built more to assume that every asset exists rigidly somewhere before you hit "go". Shalinor fucked around with this message at 20:02 on Jan 10, 2012 |
# ? Jan 10, 2012 19:51 |
|
roomforthetuna posted:You can certainly make your own vertex/index arrays, in a 'Mesh' or 'SharedMesh' object, because I have a function doing that, and you can do custom shaders. You don't so much "tell it to go draw the mesh" as attach the mesh to an object that has a mesh renderer though. Thanks for the mesh info. I had also assumed that Unity wasn't a natural platform for voxel development, but someone got it working in the video I linked to the video I linked to earlier so it seems that it is possible. I have no idea how they're doing their physics - voxel collisions are so totally different in nature from most typical systems that you really need to write your own collider class and I don't know if Unity supports that or not. Seeing that someone made voxels work in Unity has made it an interesting option again. Being able to start off with a nice editor and a lot of tools in place is a huge advantage over rolling your own thing in SDL/SlimDX/whatever.
|
# ? Jan 10, 2012 20:22 |
|
PDP-1 posted:I had also assumed that Unity wasn't a natural platform for voxel development, but someone got it working in the video I linked to the video I linked to earlier so it seems that it is possible. I have no idea how they're doing their physics - voxel collisions are so totally different in nature from most typical systems that you really need to write your own collider class and I don't know if Unity supports that or not. You can't write your own collider from scratch because PhysX, apparently. Edit: Found the post again. roomforthetuna fucked around with this message at 20:45 on Jan 10, 2012 |
# ? Jan 10, 2012 20:42 |
|
PDP-1 posted:I know next to nothing about Unity but from the one or two times I've bothered poke around at it I remember seeing warnings against using Boo. The explanation is that (a) it's not really Python and the small differences will drive Python people nuts, and (b) it's not supported on some platforms (iOS?). Yep. Its not well documented, but little in unity is!. But you definately can. My first one just created instances of cubes. Obviously thats not the final solution, so from there I've been building a big mesh out of it. If I wanted to do something serious with voxels, unity would not be my first choice (although I guess you could probably do something fun using the low level GL interface in unity, but..... meh. I'd like to avoid dotnet/mono exposure where possible). I'd probably just roll my own so I had more control over it, and that'd let me do some of the fancier sort of poo poo folks like John Carmac is doing with these bad boys. I'm just loving around to see if I can understand it better. duck monster fucked around with this message at 20:58 on Jan 10, 2012 |
# ? Jan 10, 2012 20:49 |
|
Thanks for the kind words everybody- I really appreciate it. I have very nerdy, inaccessible hobbies and it can be frustrating not being able to talk about them with anyone. Several people have expressed an interest in learning Forth, and it reminded me of a pretty spiffy programming/puzzle game I saw recently called "Ruby Warrior". In Ruby Warrior you practice elementary hipster-perl by guiding a dude around in dungeons, slaying monsters and rescuing people, all through a command-line interface. Last night I spent a few hours putting together a prototype of a similar game in Forth, except with tile-based graphics! You've skimmed the first few chapters of Starting Forth, right? You had a look at the Mako crash course to familiarize yourself with the ways my compiler's dialect diverges from Forth as discussed in that book, didn't you? Of course not. Oh well- let's dive in anyway! First, install Mako on your computer. You'll need Java and Ant. If you have git, clone my repository. Otherwise, grab this zip and put it somewhere handy. Build everything with ant: code:
code:
Glorious! It lives! Enjoy the foibles of BasicHero- it does OK on the first few levels of the game, but it's really about as dumb as a sack of hammers. You can do better! Make a copy of the HeroTemplate.fs file in the examples/Warrior/ directory and get ready to fill in the brains. code:
code:
code:
code:
code:
code:
code:
Thoughts, anybody? Internet Janitor fucked around with this message at 01:36 on Jan 11, 2012 |
# ? Jan 11, 2012 01:31 |
|
Internet Janitor posted:...Forth AI challenge... This looks really good and I'll certainly be trying it out! It reminds me of the AI challenges that Google throws on twice a year at http://aichallenge.org/. People had submitted support (interfacing with the game and so on) for more than 20 languages, perhaps next time we'll see Forth in there!
|
# ? Jan 11, 2012 01:59 |
|
I would love to see people's heroes. Combat is kinda threadbare and since Forth is a systems programming language there are a million ways to shoot yourself in the foot, but I intend to keep tinkering with it for a few days and adding things. For beginner-friendliness, the Warrior system can sometimes detect stack over/underflows for you!
|
# ? Jan 11, 2012 02:04 |
|
This is awesome! Definitely going to mess around with this, as I'm reading up on Forth and this is way more fun than doing calculator-stuff Do you make the graphics yourself? I really like it when people make proper lowres graphics and not just throw in a bunch of pixel resolutions and go "YAY PIXELS, IT'S INDIE" Also, since I'm using Windows I threw in a 'maker.bat' file with code:
|
# ? Jan 11, 2012 14:03 |
|
reminds me of redcode, I will certainly look at it - but then i know forth from lots of playing around with tinymuck and derivatives.
|
# ? Jan 11, 2012 15:02 |
|
Shalinor posted:How bizarre. I've even temporarily got this running in Update, so it should be spamming it every single frame. Time to poke through my other components... I suspect the way my AnimatedSprite class works may be interfering with me here. Dynamically generated anything in Unity just seems to confuse it, it's built more to assume that every asset exists rigidly somewhere before you hit "go". gently caress you, Unity 3D. Crap like this is why we stopped using you for our next project. EDIT: Wait, wait... there's a tint argument on the particle material UI called "Tint Color." Don't tell me... it doesn't use base color for its tint. "Because". EDIT: Yep, there, works flawlessly with "_TintColor". And Tint Color also works differently, in that it can ramp the color value as well as dampen it, which is... fine, I guess, if a bit arbitrary. See aforementioned "gently caress you, Unity 3D". Shalinor fucked around with this message at 18:41 on Jan 11, 2012 |
# ? Jan 11, 2012 18:32 |
|
Shalinor posted:Figured this out. It had nothing to do with my code, and everything to do with the way I'd set up my materials. What are you using instead, if I might ask?
|
# ? Jan 11, 2012 20:39 |
|
Unormal posted:What are you using instead, if I might ask? For small mobile games, we might still go with Unity over UDK, but for any project likely to take more than a few months... ugh, yeah, never using Unity 3D again.
|
# ? Jan 11, 2012 22:12 |
|
|
# ? Jun 9, 2024 16:31 |
|
Shalinor posted:UDK. It has a near vertical learning curve, but once you're up, I find the toolset to be substantially superior. Ah yeah; though UDK doesn't seem to have android support yet, so that's a reasonable black mark for mobile development until it does.
|
# ? Jan 11, 2012 22:32 |