• What are you working on? v16
    5,004 replies, posted
[QUOTE=RyanDv3;28232970]Careful now, you starting to sound like Joshyy[/QUOTE] Oh god. :ohdear: Uh. I take that back. :v: Edit: WAYWO sure is slow today.
It's too quiet in here. Here's my 4 color sepia cat: [img]http://img580.imageshack.us/img580/1912/fa89dbc8bdcf70e9c67c44c.png[/img]
Playing around with GLSL [img_thumb]http://img713.imageshack.us/img713/2227/lighttesty.png[/img_thumb]
Is that light?
Yeah.
[QUOTE=Orki;28232972]Ahh i thought your movement was "realtime" and not tilebased guess i was wrong maybe you should look into doing so even if it's not "roguelike" but makes for good gameplay[/QUOTE] Nah. I like the tile-based gameplay, to be honest. I might consider making the movement between tiles smooth but it'll never be "realtime".
[QUOTE=humanz;28223800]Horrible code ahead: [code] public class MessageBox { static SpriteFont debugFont; string Text; int Duration; //You should really use a double or float for this... int TimePassed; //Again, you should really use a double or a float for this... bool Visible = false; public MessageBox(string Text, int Duration) { this.Text = Text; this.Duration = Duration; } public void Show(GameTime gameTime) { Visible = true; TimePassed = gameTime.TotalGameTime.Seconds; } public static void LoadContent(ContentManager Content) { debugFont = Content.Load<SpriteFont>("Fonts/Debug"); } public void UnloadContent() { //You Really need something here, otherwise it's pointless... } public void Update(GameTime gameTime) { if (Visible) //You don't need the "== true" you can just use this //If you want to check something is false use !Visible { //TimePassed = gameTime.TotalGameTime.TotalSeconds if (TimePassed >= Duration) { Visible = false; UnloadContent(); } } } public void Draw(GameTime gameTime, SpriteBatch spriteBatch) { if (Visible) { spriteBatch.DrawString(debugFont, this.Text, new Vector2(25, 25), Color.Black); } } } [/code] Could someone teach me a better way to do it?[/QUOTE] Not sure if that's 100%, posting from my phone...
[img]http://ahb.me/1VBX[/img] Look, a blank proje- Nevermind, it's the useless start to a GUI.
I've rewritten the way my networking works. Before, each entity had a list of packet types and interpreted them based on this. This meant declaring for example PlayerData.Generic and then sending everything, PlayerData.Angle and sending the angle etc. Now I have a function in the base entity that it'll fall back to that nicely syncs all the angles, flags etc that all entities share. They can then implement their own packets on top. This took ages to debug because I had a local with the same name as a field. Facepalm. [img]http://img.meteornet.net/uploads/1egb19d7f/ss.PNG[/img] Now I have my light entity parented to my player entity. My good friend Spacerat who is also working on this project has finished the lua integration too. It still segfaults the server after a few frames but that is a minor issue :v: The contents of lua/items/flashlight.lua is [lua] entity.on = false entity.myLight = nil entity.LastFire = 0 entity.ImageName = "test gun" function entity:onFire() if MilliSecs() > self.LastFire then self.LastFire = MilliSecs() + 500 else return end self.on=self.on==false if self.on then self.myLight = NewLight() self.myLight.Pos = self.Pos self.myLight.sprite = "light_slice" self.myLight.Ang = self.Ang self.myLight:Spawn() self.myLight:SetParent(self) else self.myLight:Remove() self.myLight=nil end end [/lua] This creates the entity seen above. Familiar? :D Bonus: [img]http://img.meteornet.net/uploads/1egb19d7f/Screen_shot_2011-02-23_at_2.06.46_PM.png[/img]
I drew a maze in mspaint by hand :smug: [img]http://filesmelt.com/dl/maze_gen.gif[/img]
[QUOTE=limitofinf;28242905]I drew a maze in mspaint by hand :smug: -snipped gif-[/QUOTE] :golfclap: My sub-par internet connection really didn't like that 18MB gif, though. :frown: Edit: Adblocked it :v:
[QUOTE=BlkDucky;28242946]:golfclap: My sub-par internet connection really didn't like that 18MB gif, though. :frown: Edit: Adblocked it :v:[/QUOTE] :v: Sorry.
[QUOTE=Catdaemon;28242069]Real men use Lua.[/QUOTE] It's looking really nice. Quick question, how are you making such nice shadows? Anyway, here is what a lot of code (in the engine) achieves: [cpp] void Aftershock::Render() { m_pCamera->Apply(); m_pRenderer->Begin(ENGINE_CLEAR_TARGET | ENGINE_CLEAR_ZBUFFER, ENGINE_XRGB(0, 0, 0), 1.0f); Rect->Render(); Rect2->Render(); m_pRenderer->End(); } [/cpp] [img]http://f.anyhub.net/1VCG[/img] I'm going to clean up the code and separate rendition from logic. Then finish off my scene manager.
[QUOTE=DevBug;28243193]It's looking really nice. Quick question, how are you making such nice shadows? [/QUOTE] Intense CPU grinding via the gamedev.net article's method. It's pretty slow so the optimisations I have done are to A) only draw lights on the screen and B) Generate hulls of the shadow casting tiles ahead of time and use those instead. [img]http://img.meteornet.net/uploads/9asf/ss.PNG[/img]
[QUOTE=limitofinf;28242905]I drew a maze in mspaint by hand :smug: [img_thumb]http://filesmelt.com/dl/maze_gen.gif[/img_thumb][/QUOTE] Could you please share that one? :D really nice.
[QUOTE=Catdaemon;28243355]Intense CPU grinding via the gamedev.net article's method. It's pretty slow so the optimisations I have done are to A) only draw lights on the screen and B) Generate hulls of the shadow casting tiles ahead of time and use those instead. [img_thumb]http://img.meteornet.net/uploads/9asf/ss.PNG[/img_thumb][/QUOTE] More specifically, the fading. A 1D texture?
[QUOTE=DevBug;28243462]More specifically, the fading? A 1D texture?[/QUOTE] The fading is just the shadows not drawing on the light source. The lights are white png images.
[QUOTE=Catdaemon;28243490]The fading is just the shadows not drawing on the light source. The lights are white png images.[/QUOTE] Ah, thought there was more to it. Thanks for clearing it up.
[QUOTE=likesoursugar;28243426]Could you please share that one? :D really nice.[/QUOTE] Sure, but what do you mean by share? The source code?
I think I finally came up with an appealing map generation algorithm! [img]http://i.imgur.com/bCjs3.png[/img] It's not perfect, but it's a lot better than what I was doing before. Basically, it generates a maze that almost fills the screen, chops down a few walls, and then builds a few rooms. It has dead ends, but they shouldn't be that big of a deal... I can always just get rid of them after the maze has been generated, which shouldn't be that hard. All of the generation is random/procedural. I'm really pleased with the result! :v:
[QUOTE=limitofinf;28242905]I drew a maze in mspaint by hand :smug: -dick move-[/QUOTE] thanks for that definitely-not-cpu-or-bandwidth-straining 18mb 18819 frame gif.
Yea, that GIF made Safari legit take a shit on me.
Woah we are 7 pages into a new waywo and I didn't even notice :frown: My internship is coming to an end now, I'm doing a presentation on what I have been doing to a research forum in an hours time, I'll probably post the lecture slides here and maybe some screenshots of my program for anyone that is interested.
[QUOTE=r4nk_;28246085]Woah we are 7 pages into a new waywo and I didn't even notice :frown: My internship is coming to an end now, I'm doing a presentation on what I have been doing to a research forum in an hours time, I'll probably post the lecture slides here and maybe some screenshots of my program for anyone that is interested.[/QUOTE] What happend to that render of your university you were doing>?
[img]http://i.imgur.com/li6lw.png[/img] ...now with DOORS! :woop:
[QUOTE=Richy19;28246277]What happend to that render of your university you were doing>?[/QUOTE] That was last semester for a uni project, it's finished with AI, emotion, physics and chat dialogs etc and I was gonna make a video of it but I never got around to it. So I'll do that soon too :)
[QUOTE=spear;28246289]-snimage- ...now with DOORS! :woop:[/QUOTE] Wow, that's way better than mine. Mind sharing the algorithm/code? :downs:
[QUOTE=limitofinf;28243723]Sure, but what do you mean by share? The source code?[/QUOTE] Here, if anyone cares: [cpp] public class Path { public int x; public int y; public int oldX; public int oldY; public Path(int x, int y, int oldX, int oldY) { this.x = x; this.y = y; this.oldX = oldX; this.oldY = oldY; } public int midX { get { return (x + oldX) / 2; } } public int midY { get { return (y + oldY) / 2; } } } public static Random rand = new Random(); public static void Shuffle<T>(List<T> list) { for (int i = list.Count - 1; i > 0; --i) { int j = rand.Next(i + 1); T temp = list[i]; list[i] = list[j]; list[j] = temp; } } public static void Main(string[] args) { Thread.Sleep(10000); int w = 128; int h = 128; int[] maze = new int[w * h]; Stack<Path> stack = new Stack<Path>(); stack.Push(new Path(0, 0, 0, 0)); while (stack.Count > 0) { Path next = stack.Pop(); if (maze[next.x + next.y * w] == 1) continue; maze[next.x + next.y * w] = 1; maze[next.midX + next.midY * w] = 1; int off = 128; MouseMove(next.midX * 5 + off, next.midY * 5 + off); MouseDown(0); MouseUp(0); Thread.Sleep(10); MouseMove(next.x * 5 + off, next.y * 5 + off); MouseDown(0); MouseUp(0); Thread.Sleep(10); List<Path> list = new List<Path>(); list.Add(new Path(next.x + 2, next.y, next.x, next.y)); list.Add(new Path(next.x - 2, next.y, next.x, next.y)); list.Add(new Path(next.x, next.y + 2, next.x, next.y)); list.Add(new Path(next.x, next.y - 2, next.x, next.y)); Shuffle(list); foreach (Path i in list) { if (i.x >= 0 && i.x < w && i.y >= 0 && i.y < h) stack.Push(i); } } } [/cpp] It's not great code by any means, but it works :madmax:
So for my Robotics team, I have been commissioned to, during the off-season, write a two-part program. Part 1: It records data on the robot as we drive it around. Part 2: It simulates the robot onscreen as you move the joysticks. It uses the data it collected. I am not looking forward to it.
[QUOTE=ZenX2;28247354]Wow, that's way better than mine. Mind sharing the algorithm/code? :downs:[/QUOTE] Sure! Here's the code: [url]http://f.anyhub.net/1VIg[/url] (WARNING: this code may look really bad to a professional). I didn't make it with the intention of sharing it/using it in a real project (it should, however, compile if you have g++ and ncurses), but it shouldn't be that complicated - if you would like, I can add comments. Also, it's not built for efficiency, unfortunately, but it shouldn't be that difficult to make more efficient adaptations of it. What it does is create a maze by selecting an initial random position on the screen and then jumping by 2 in random directions for as long as it can (it checks to make sure it doesn't jump into an already paved-out area). When it gets stuck, it jumps to another random position that's already been paved out, making sure that it doesn't disrupt the structure of the maze (i.e. single cell thick corridors). After enough steps have been made, it then clears out a random number of walls that have (at least? I forget) two adjacent paved-out cells, to make the maze a bit more open. Then, it creates rooms! It selects random x-y positions, generates random room sizes, and checks to make sure that that the top-left corner has a wall above and to the left of it, and that the bottom-right corner has a wall below and to the right of it (this just makes the rooms pave tiles out of the maze a bit more cleanly). When rooms are created, the bool in_room for the ground tiles in that room is set to true. Then, doors are created (I believe this happens during the creation of the rooms): if a tile is in a room (map[y][x].in_room = true) and it has an adjacent ground tile that isn't in a room, it changes that tile's type to a door. Then, any double, triple, etc. doors are purged from the room. That's pretty much it! Enjoy! If you have any questions, please ask.
Sorry, you need to Log In to post a reply to this thread.