• What are you working on? v15
    5,001 replies, posted
[img]http://data.fuskbugg.se/dipdip/_____________________________________________________________________________Sk%E4rmklipp.JPG[/img] Working on a small game project wont be going into detail but i got saving, loading, map generating, digging and collisions implemented. Oh, special price for the one who guess where the tiles are stolen from! Edit: And no, it's not minecraft in 2d.
[QUOTE=CarlBooth;27305234]It runs fine on here.[/QUOTE] I installed FroYo on my 3G, it was unbearably slow. Maybe they've written video acceleration drivers since then..?
[QUOTE=Darwin226;27306278]Fraps captures anything that renders with OpenGL or DX. Fullscreen not needed.[/QUOTE] Yea but if its not fullscreen I preffer Camstudio Allthough i think camstudio can do fullscreen as well
[QUOTE=Tortex;27306495] Oh, special price for the one who guess where the tiles are stolen from! Edit: And no, it's not minecraft in 2d.[/QUOTE] Minecraft in 3D?
[QUOTE=Tortex;27306495]Oh, special price for the one who guess where the tiles are stolen from! Edit: And no, it's not minecraft in 2d.[/QUOTE] Well the player is from Lewt, or where lewt got his. The tiles i have seen before and im sure i have played the game recently but i cant remember the name [editline]9th January 2011[/editline] [QUOTE=ralle105;27306624]Minecraft in 3D?[/QUOTE] Lol yea it must be
[QUOTE=Tortex;27306495] Oh, special price for the one who guess where the tiles are stolen from![/QUOTE] Minecraft and lewt
The code needs to be cleaned up and there is missing functionality, but it's now possible to draw something with OOGL without writing different code for different platforms. [img]http://www.imgdumper.nl/uploads3/4d29f91e132f7/4d29f91e0062a-OOGL_triangle_winlin.png[/img] [code]//////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include <oogl/Window.hpp> #include <iostream> const char* vertexShaderSource = "in vec2 in_Position;\ in vec3 in_Color;\ varying vec3 ex_Color;\ void main()\ {\ gl_Position = vec4( ( in_Position.x - 400.0 ) / 400.0, ( 300.0 - in_Position.y ) / 300.0, 0.0, 1.0 );\ ex_Color = in_Color;\ }"; const char* fragmentShaderSource = "varying vec3 ex_Color;\ void main()\ {\ gl_FragColor = vec4( ex_Color, 1.0 );\ }"; int main() { GL::Window window( 800, 600, 0, 0, "OpenGL Triangle", GL::WindowFlags::Caption | GL::WindowFlags::CenterScreen ); GL::Context& gl = window.GetContext(); GL::Shader vertexShader( GL::ShaderType::Vertex ); GL::Shader fragmentShader( GL::ShaderType::Fragment ); vertexShader.Source( vertexShaderSource ); fragmentShader.Source( fragmentShaderSource ); try { vertexShader.Compile(); fragmentShader.Compile(); } catch ( GL::ShaderCompileException& e ) { std::cerr << "Shader compilation failed:" << std::endl << e.what(); return 1; } GL::Program program; program.Attach( vertexShader ); program.Attach( fragmentShader ); program.BindAttribLocation( 0, "in_Position" ); program.BindAttribLocation( 1, "in_Color" ); try { program.Link(); } catch ( GL::ProgramLinkException& e ) { std::cerr << "Program linking failed" << std::endl << e.what(); return 1; } program.Use(); float vertices[] = { 50.0f, 50.0f, 1.0f, 0.0f, 0.0f, 750.0f, 50.0f, 0.0f, 1.0f, 0.0f, 750.0f, 550.0f, 0.0f, 0.0f, 1.0f }; GL::VertexBuffer vbo( vertices, sizeof( vertices ), GL::BufferUsage::StaticDraw ); gl.VertexAttribLocation( 0, 2, GL::Type::Float, 5 * sizeof( float ) ); gl.VertexAttribLocation( 1, 3, GL::Type::Float, 5 * sizeof( float ), 2 * sizeof( float ) ); gl.ClearColor( 0.0f, 0.0f, 0.0f ); while ( window.IsOpen() ) { window.GetEvents(); gl.Clear( GL::Buffer::Color ); gl.DrawArrays( GL::Primitive::Triangles, 0, 3 ); window.Present(); } return 0; }[/code]
I'll start with the collision, finally [img]http://img211.imageshack.us/img211/6100/5869c2191d9dd82af619666.png[/img]
[QUOTE=q3k;27306548]I installed FroYo on my 3G, it was unbearably slow. Maybe they've written video acceleration drivers since then..?[/QUOTE] Not that I am aware of. But I think they have optimized it a bit, it is still slightly slow, but it is much better than it used to be. iDroid represent.
Genetic algorithms = win. I'm not quite sure how to evolve them though, I was just going to make a punnett square for each trait and randomly pick a square, is their a better way? [editline]9th January 2011[/editline] Actually, I think that would only work on modeling humans or just doing variants (Eg a randomly generated city), fitness testing is the way to go.
[QUOTE=neos300;27308954]Genetic algorithms = win. I'm not quite sure how to evolve them though, I was just going to make a punnett square for each trait and randomly pick a square, is their a better way? [editline]9th January 2011[/editline] Actually, I think that would only work on modeling humans or just doing variants (Eg a randomly generated city), fitness testing is the way to go.[/QUOTE] Are you sure this is the right thread?
Hmm. I was going to take a video of my animated perlin noise, until i realised that regardless of what i did it looked like shit.
[img]http://no-named.dk/files/upload/tictactoe.png[/img] First time using C++, but I have lots of actionscript experience.
[QUOTE=iRzilla;27308966]Permaban me too then. Tired of this community. [highlight](User was permabanned for this post ("Requested." - Pascall))[/highlight][/QUOTE] Awesome. He was a completely normal poster up until about 10 weeks ago then went bat-shit insane. No idea what happened.
[QUOTE=Dryvnt;27309066]Are you sure this is the right thread?[/QUOTE] He missed the evil scientist thread.
[QUOTE=Ortzinator;27310337]He missed the evil scientist thread.[/QUOTE] I'm actually pretty sure he missed the Genetic Algorithms thread.
[QUOTE=CarlBooth;27310286]Awesome. He was a completely normal poster up until about 10 weeks ago then went bat-shit insane. No idea what happened.[/QUOTE] I never really liked rzilla, but the retrospective "haha, good riddance" statement that comes whenever anyone get's ejected from the community is just silly. Besides, tell me you haven't once considered leaving facepunch over some issue. Yeah, it sounds lame to care that much, but we've all thought about it. I personally consider leaving every time I visit "In the News".
[QUOTE=Tortex;27306495] Working on a small game project wont be going into detail but i got [b]saving, loading, map generating, digging and collisions implemented.[/b] Edit: And [b]no, it's not minecraft in 2d.[/b][/QUOTE] Haha, alright then. Ladies and Gentlemen let me remind you we have a 3 drink minimum here at the Facepunch Comedy Club, enjoy your stay. (I'm only kidding, it looks very nice :buddy:) Anyway I'm working on map loading for my little platformer. Rick Dark was nice enough to share his map format so I've copied it and I'm now working on loading the info from it. Had to take a break because I haven't eaten all day and I'm getting that weird "programmer's stare" where you've looked at words for so long you wonder why they're spelled the way they are. I literally spent 15 minutes wondering why "Tile" was spelled "Tile", and how funny the letters looked. Anyway heres the code so far, though I feel like its terribly terribly unoptimized, I can't really be bothered to think too far out of the box before I start wondering why box is spelled "box". [csharp]void LoadMap(std::string name) { //Ouput Vars std::string backdrop; std::string tileRefs[8]; std::ifstream in; in.open(("maps/" + name + ".txt").c_str()); if (in.is_open()) { int line = 0; bool isDef = false; bool isTileDef = false; int tileRefNum = 0; std::string output; while (!in.eof()) { std::getline(in, output); line++; if (line == 1) { backdrop = output; } else if (isTileDef) { int i; for (i=0; i<=output.length(); i++) { //GOOD GOD MAN, TAKE A FUCKING BREAK } } else { if (output == "startdef") isDef = true; if (output == "enddef") { isDef = false; isTileDef = true; } if (isDef && output != "startdef" && output != "enddef") { tileRefs[tileRefNum] = output; tileRefNum++; } } } std::cout << "Backdrop: " << backdrop << "\n\n"; std::cout << "Tiles: " << std::endl; for (i=0; i<=7; i++) { std::cout << i << ": " << tileRefs[i] << std::endl; } } in.close(); }[/csharp] The map is formatted like this, in a text file: [code] media/image/backdrop/map1.jpg startdef media/image/tile/grass.jpg media/image/tile/dirt.jpg media/image/tile/sky.jpg enddef 2 1 0.0 550.0 1 1 1 0.0 500.0 1 3 0 0.0 450.0 1 3 0 0.0 400.0 1 [/code] So far it successfully parses and saves the backdrop and the tiles to be used, now I just need to load all the info about each tile, which I'm not looking forward to. [img]http://content.screencast.com/users/Kopimi/folders/Jing/media/13ef1a66-4c60-4143-baba-9d11080f89f0/2011-01-09_1358.png[/img]
[QUOTE=RyanDv3;27310505]I never really liked rzilla, but the retrospective "haha, good riddance" statement that comes whenever anyone get's ejected from the community is just silly. Besides, tell me you haven't once considered leaving facepunch over some issue. Yeah, it sounds lame to care that much, but we've all thought about it. I personally consider leaving every time I visit "In the News".[/QUOTE] I have never considered leaving Facepunch, because nothing on the Internet is important enough for me to care THAT much about it. Also, I never said "good riddance" or any words to that effect.
I consider leaving whenever I see all of the militant athiests on this forum, which is often in the In The News section. You're just as bad as any religion could ever be when you act like that. [/offtopic]
[QUOTE=Kopimi;27310532]text[/QUOTE] My map files look like this in Notepad++ [img]http://dl.dropbox.com/u/17769468/What%20is%20this.png[/img] Although this file has no tiles... yet! I made my own format. Pretty straightforward too.
[QUOTE=Jawalt;27310581]I consider leaving whenever I see all of the militant athiests on this forum, which is often in the In The News section. You're just as bad as any religion could ever be when you act like that. [/offtopic][/QUOTE] Hey man, being a teenage atheist is hard, can you blame them? It's not like atheism is a widely accepted and widely held belief in most modern countries, no no, not like that at all. Thats why its necessary for them to get online and remind everyone of how atheist they are.
I dont understand why people do stupid plaintext formats, their a pain in the arse to parse and they almost always end up huge I dont get why people use Lua to store maps either, we got JSON for that
[QUOTE=commander204;27310720]My map files look like this in Notepad++ [img_thumb]http://dl.dropbox.com/u/17769468/What%20is%20this.png[/img_thumb] Although this file has no tiles... yet! I made my own format. Pretty straightforward too.[/QUOTE] That looks fantastic! I doubt I'll be keeping a text based map format for any projects other than my current one, but really I'm just trying to keep things barebones so I can actually finish a project for once.
Well the save/loading is handled by a static class and is like this: (C#) [code] public static Map LoadMap(string p) { Map newmap = new Map(); List<Tile> tiles = new List<Tile>(); using (FileStream stream = new FileStream(p, FileMode.Open)) { using (BinaryReader reader = new BinaryReader(stream)) { newmap.name = reader.ReadString(); int tileCount = reader.ReadInt32(); for (int i = 0; i < tileCount; i++) { Tile newTile = new Tile(); newTile.position = new Vector2(); newTile.rotation = new Vector2(); newTile.position.X = reader.ReadInt32(); newTile.position.Y = reader.ReadInt32(); newTile.rotation.X = reader.ReadInt32(); newTile.rotation.Y = reader.ReadInt32(); newTile.tex = TileEngine.content.Load<Texture2D>(reader.ReadString()); tiles.Add(newTile); } newmap.tiles = tiles; } } return newmap; } static public bool SaveMap(Map mapToSave, string filename) { using (FileStream stream = new FileStream(filename,FileMode.Create))//"content/maps/" + filename + ".saonirmap" { using (BinaryWriter writer = new BinaryWriter(stream)) { writer.Write(mapToSave.name); //Name of the map writer.Write(mapToSave.tiles.Count); //The number of tiles so we know how many will come! foreach(Tile tile in mapToSave.tiles) { writer.Write((int)tile.position.X); writer.Write((int)tile.position.Y); writer.Write((int)tile.rotation.X); writer.Write((int)tile.rotation.Y); writer.Write("lol"); //tile.tex.Name } writer.Close(); } } return true; } [/code] I don't have to parse it or anything, I was really surprised it is so easy. (But I think there are a lot of open doors for hacking in)
[QUOTE=Jawalt;27310581]I consider leaving whenever I see all of the militant athiests on this forum, which is often in the In The News section. You're just as bad as any religion could ever be when you act like that. [/offtopic][/QUOTE] [Moreofftopicreligeousargumentwhichprobablydoesntbelonginwaywobutwhathehell,youpostedaboutitfirst] yeah, but atheism hasnt killed quite the same number of people [/seebegintag]
[QUOTE=Icedshot;27311292][Moreofftopicreligeousargumentwhichprobablydoesntbelonginwaywobutwhathehell,youpostedaboutitfirst] yeah, but atheism hasnt killed quite the same number of people [/seebegintag][/QUOTE] Religion doesn't kill people, bigotry does, and militant atheists are bigots.
What the general rule of thumb (if that's the right phrase) when choosing between a static class and passing references? (in C# but it should apply to any OOP)
[img]http://gyazo.com/9d972992af7674fa3e79449023da647e.png[/img] Application theme
[img]http://i.imgur.com/Qh2wC.png[/img] A pixel-y game about a pixel-y man who is the only one who can save the world from ultimate destruction, going to the Mac App Store.
Sorry, you need to Log In to post a reply to this thread.