• What are you working on? December 2011 Edition
    3,353 replies, posted
[QUOTE=Jookia;33695957]What language?[/QUOTE] C#/XNA. Should be kind of apparent by now because Cornflower blue. Cornflower blue everywhere.
[QUOTE=Yogurt;33695976]C#/XNA. Should be kind of apparent by now because Cornflower blue. Cornflower blue everywhere.[/QUOTE] [cpp] // All but underused // What're you going to do // My Cornflower Blue renderTarget.Clear(sf::Color(100, 149, 237));[/cpp]
This is a bit harder than C#.
So i have been working on a basic 2d java game engine that uses lwjgl. I made it just in my spare time and i plan to use it for a project at uni next year. I am just getting all the basic features in atm but its going along nice. Here is a feature list so far. BGE Biths game engine. A basic 2d rectangle collision based game engine. Used for making simple and easy 2d games. Features 2d basic box Collisions Sprites and image loading Colour changing on sprites Easy inheritance implementation Camera system Mouse and keyboard event handling. Error handling Console System Properties system File system Timer System Event System(Needs neatening up) Entity system that handles drawing and collisions. It does a bit more like lines (which took me 2 hours to implement. not sure why haha) Anyway i did a simple vid below showing the camera movement and zoom (it orientates around the topleft i will change that.) it also shows mouse clicks and sprite animation. On an related note does anyone know of any good lwjgl text or font libraries. Im having a really hard time figuring out how to do text. Anyway here it is [MEDIA]http://www.youtube.com/watch?v=qIYOFC5TXFQ&feature=youtu.be[/MEDIA]
Alright, i300 is uploading the project to github for me because I don't know how. In a few minutes EVERYONE can use my UI library!
[IMG]http://img707.imageshack.us/img707/610/audiophilia201112122123.png[/IMG] The Unicode thing randomly fixed itself :v:
I assume the scrollbar is temporary? It really doesn't fit.
[QUOTE=ultradude25;33696542]I assume the scrollbar is temporary? It really doesn't fit.[/QUOTE] Yeah haven't implemented it's skin yet.
[QUOTE=Jacen;33695669]... What I want to do is iterate through the list to update and remove any particles that are dead. I found this when searching and tried out the first answer. [url]http://stackoverflow.com/questions/596162/can-you-remove-elements-from-a-stdlist-while-iterating-through-it[/url] This is what I got. [code]void Particle_System::Update() { std::list<Particle*>::iterator it = parts.begin(); while(it != parts.end()) { *it->Update(); if (*it->life_left <= 0) { parts.erase(it); } it++; } }[/code] [/QUOTE] In my experience, removing elements like this is not a good idea. It is much better to do it like this: [code] void Particle_System::Update() { for (std::list<Particle*>::iterator it = parts.begin(); it != parts.end(); ) { if ((*it)->life_left > 0) { (*it)->Update(); ++it; } else //particle life is <= 0 { it = parts.erase(it); //note here: when you erase an element, it returns an iterator //pointing to the next value, which avoids corruption } } } [/code]
[QUOTE=Parad0x0217;33696606]In my experience, removing elements like this is not a good idea. It is much better to do it like this: [code] void Particle_System::Update() { for (std::list<Particle*>::iterator it = parts.begin(); it != parts.end(); ) { if ((*it)->life_left > 0) { (*it)->Update(); ++i; } else //particle life is <= 0 { i = parts.erase(i); //note here: when you erase an element, it returns an iterator //pointing to the next value, which avoids corruption } } } [/code][/QUOTE] Thanks. That fixed the other problem I was having.
I do parts.erase(i++) for readability. It let's you check to make sure that the iterator is being incremented in all cases easily.
[IMG]http://i44.tinypic.com/mjp99j.png[/IMG] More updates to my Battlefield-like game [b]DOWNLOAD THE GAME AND TRY IT YOURSELF[/b](Windows only for now) [url]http://mediafire.com/?gk2fp94hvib6h91[/url] Controls: -WASD to move player -Arrow keys to move in vehicles -Left click to fire weapon -Enter key to enter and exit vehicle Right now there are no control points or ways to win but I need people to find bugs and give me some ideas I guess
[QUOTE=Meller Yeller;33697208][IMG]http://i44.tinypic.com/mjp99j.png[/IMG] More updates to my Battlefield-like game [b]DOWNLOAD THE GAME AND TRY IT YOURSELF[/b](Windows only for now) [url]http://mediafire.com/?gk2fp94hvib6h91[/url] Controls: -WASD to move player -Arrow keys to move in vehicles -Left click to fire weapon -Enter key to enter and exit vehicle Right now there are no control points or ways to win but I need people to find bugs and give me some ideas I guess[/QUOTE] You need to make trees fade out when you walk under them so you can see your character
[QUOTE=thisBrad;33697234]You need to make trees fade out when you walk under them so you can see your character[/QUOTE] Or make it so you can see the outline of objects under them.
Got a pretty good main menu background for Airedale, it's basically just the map moving around using some sine and cosine magic. Now I need to start thinking about what I'm actually going to put in the game :v:
Since Yogurt went offline, here's his awesome GUI Library. [url]https://github.com/YogurtFP/YogUI[/url] [img]http://i.imgur.com/zM4mW.png[/img]
Rebuilding the whole of glib* family for VS2010.. :suicide:
Time to start on the actual audio engine for my audio player :v:
Decided to re-code my whole math library as my old one was a real mess, so I've been spending the last two nights working on it. It's a lot easier now when I've actually read linear algebra in school. Also took the time to start unit-testing my code which I think will save me a lot of headaches in the future :v:
In my engine I want everything to be clickable by the mouse (any shape that is). Now I know how I can check if the mouse is inside the shape, the only problem is that the shapes are defined by a mesh, and a set of transformation matrices. If I wanted to get the actual shape that's drawn on the screen, I would need to recalculate the points every time the shape moves, rotates or scales. That's obviously very inefficient, I mean, the GPU is considered fast because it does those exact tasks much faster. Is there any alternative? Maybe a way to get the shape back from the GPU after it's mutliplies by the matrices there? Or maybe just a way to get the triangle that's under the mouse and then determine which shape it belongs to?
[QUOTE=i300;33697695]Since Yogurt went offline, here's his awesome GUI Library. [url]https://github.com/YogurtFP/YogUI[/url] [img]http://i.imgur.com/zM4mW.png[/img][/QUOTE] git protip: add a .gitignore to ignore the /bin and /obj folders, that way you don't get strange conflicts with the exe later if you're trying to merge something. Forked the repo, added a pretty good .gitignore file from another project of mine, cleaned out the committed cache files. Installing XNA Game Studio to make sure I didn't delete anything critical before I push. I'll send you a pull request on github once I know it works. [editline]a[/editline] Pull request sent!
Working on implementing texel interpolation into the SmartFilter shader. I've got better results than bilinear filtering so far: [url=http://i.imgur.com/88ms8.png][img]http://i.imgur.com/88ms8s.png[/img][/url][url=http://i.imgur.com/n50pr.png][img]http://i.imgur.com/n50prs.png[/img][/url] (click to enhance) Excuse the blurry edges, I disabled most of the detection code for testing. edit: Other post here: [url]http://www.facepunch.com/threads/1144771?p=33657092&highlight=#post33657092[/url]
[lua] require( "facepunch" ) local thread = require( "facepunch.thread" ) local session = require( "facepunch.session" ) local mySession = session( "LuaStoned" ) facepunch.setSession( mySession ) local err, post = thread.getPostByID( 1144771, 1325 ) print( post ) print( " post id: " .. tostring( post.postID ) ) print( " post date: " .. tostring( post.postDate ) ) print( " link: " .. tostring( post.link ) ) print( " post ratings: " .. ( post.postRatings == nil and tostring( post.postRatings ) or "" ) ) if ( post.postRatings ) then for name, amount in pairs( post.postRatings ) do print( " " .. name .. " x " .. amount ) end end post:rate( "Zing" )[/lua] [code] luajit test\ratePost.lua post: 1325 post id: 33698256 post date: 39 Minutes Ago link: http://www.facepunch.com/threads/1144771?p=33698256&viewfull=1#post33698256 post ratings: Useful x 1 [/code] :v:
[QUOTE=Meller Yeller;33697208] More updates to my Battlefield-like game [b]DOWNLOAD THE GAME AND TRY IT YOURSELF[/b](Windows only for now) [url]http://mediafire.com/?gk2fp94hvib6h91[/url] Controls: -WASD to move player -Arrow keys to move in vehicles -Left click to fire weapon -Enter key to enter and exit vehicle Right now there are no control points or ways to win but I need people to find bugs and give me some ideas I guess[/QUOTE] Really nice, I like it. A couple suggestions I have are: 1. Enable "point of conflict" markers. Basically they're small triangles/other symbols on the sides of the screen that shows where the largest battle is currently taking place on the map. They move accordingly when you move. I had trouble finding out where everyone was at some times, but since all the NPCs move in the same direction towards the nearest enemy, I could figure it out while passing one of my own teammembers. Markers would just help a bit. 2. Match the enemy tank/helicopter sprite colors to the enemy infantry. Helps distinguish sides a bit better. 3. Make helicopters/tanks have a jitter/slight random movement when they are close to being destroyed. Gives a sense of having difficulty controlling a badly damaged vehicle. I also really like the flames/sparks that they emit as they receive damage. Looking forward to your next update. Thanks.
Done building glib, gio, gmodule, gobject, gthread, libffi, sigc++, libxml2, libxml++, glibmm, giomm, gstreamer, and done building the gstreamer core plugins.. all in one day's work. Building this shit for VS was a nightmare though, the solution files they provide are so outdated they don't even include most of the recent projects' files. Now to rest of the plugins.. then gstreamermm.. I cringe at the dependencies. :suicide: On the other hand, the pre-packaged OSSBuild version of gstreamer was released in 2006, so I think it'll be worth it in the end.
If you had to fix up the sln files to get them to compile properly, consider submitting a patch to the projects. Someone's gotta keep them up to date... (and you'll feel better for contributing to open source!)
[QUOTE=robmaister12;33699015]If you had to fix up the sln files to get them to compile properly, consider submitting a patch to the projects. Someone's gotta keep them up to date... (and you'll feel better for contributing to open source!)[/QUOTE] Yeah, I was actually considering that. I merged all of them in one big solution though, not sure if it'll be easy to separate them but I might do it anyway.
Finally got my Mp3 decoding working :)
[QUOTE=thisBrad;33699177]Finally got my Mp3 decoding working :)[/QUOTE] Weren't you working on an MMO?
[QUOTE=Darwin226;33698047]In my engine I want everything to be clickable by the mouse (any shape that is). Now I know how I can check if the mouse is inside the shape, the only problem is that the shapes are defined by a mesh, and a set of transformation matrices. If I wanted to get the actual shape that's drawn on the screen, I would need to recalculate the points every time the shape moves, rotates or scales. That's obviously very inefficient, I mean, the GPU is considered fast because it does those exact tasks much faster. Is there any alternative? Maybe a way to get the shape back from the GPU after it's mutliplies by the matrices there? Or maybe just a way to get the triangle that's under the mouse and then determine which shape it belongs to?[/QUOTE] It's a collision detection problem. You take two screen-space points at a=<x, y, 1, 1> and b=<x, y, 0, 1> and turn them into world-space points by multiplying them by the inverse projection/view matrix. The world-space picker ray is found from the world space coordinates, a' and b', beginning at b' and pointing in direction a'-b'. And then you do collision detection between this ray and the collision hulls for each object (well, preferably not [i]each[/i], hopefully you have some means of culling) in your scene and find the closest point of intersection.
Sorry, you need to Log In to post a reply to this thread.