• What are you working on? November 2011 Edition
    3,673 replies, posted
[QUOTE=Yogurt;33400956]It does.[/QUOTE] Not in the video... (or you have some other similar bug). Anyway, it still looks promising. :smile:
[QUOTE=Yogurt;33400956]It does.[/QUOTE] What about when you had shallow water kind of dancing over a gap and not actually falling down it?
[QUOTE=Ziks;33401132]What about when you had shallow water kind of dancing over a gap and not actually falling down it?[/QUOTE] Take a look for yourself. [csharp] setBlockOnPlaced((x, y, notify) =>{ GameServer.scheduleUpdate(x, y, 1); }); setBlockOnUpdated((x, y) => { byte curBlockMD = GameServer.getBlockMDAt(x, y); if(curBlockMD <= 0 || curBlockMD > 100){ GameServer.setBlock(x, y, 0, true, 0); return -2; } byte blockDown = GameServer.getBlockIDAt(x, y + 1); byte blockLeft = GameServer.getBlockIDAt(x - 1, y); byte blockRight = GameServer.getBlockIDAt(x + 1, y); byte blockDownMD = GameServer.getBlockMDAt(x, y + 1); byte blockLeftMD = GameServer.getBlockMDAt(x - 1, y); byte blockRightMD = GameServer.getBlockMDAt(x + 1, y); byte shareAtATime = 1; //Test downwards first, then if that's not an option test right/left. if(blockDown == 0){ //Beam me down, scotty! GameServer.setBlock(x, y + 1, 10, true, curBlockMD); GameServer.setBlock(x, y, 0, true, 0); //We don't need no DAMN updates anymore! return -2; } else if(blockDown == 10 && blockDownMD < 100){ if(curBlockMD + blockDownMD <= 100){ //We can simply merge with the lower block. GameServer.setBlockMetaData(x, y + 1, (byte)(curBlockMD + blockDownMD)); GameServer.setBlock(x, y, 0); return -2; } else{ //We would overflow the block. int remove = 100 - blockDownMD; GameServer.setBlockMetaData(x, y, (byte)(curBlockMD - remove)); GameServer.setBlockMetaData(x, y + 1, (byte)100); return 1; } } //Testing left/right else{ //Don't share if the water level is too low. if(curBlockMD <= 1){ //GameWorld.setBlock(x, y, 0); //return 1; } //Let's test right/left. bool leftCanReceive = (blockLeft == 0 || blockLeft == 10) && blockLeftMD < 100; bool rightCanReceive = (blockRight == 0 || blockRight == 10) && blockRightMD < 100; bool both = leftCanReceive && rightCanReceive; if(leftCanReceive){ if(blockLeft == 0){ byte toShare = shareAtATime; if(curBlockMD <= shareAtATime){ toShare = (byte)(curBlockMD); } curBlockMD -= (byte)toShare; GameServer.setBlock(x - 1, y, 10, true, (byte)toShare); GameServer.setBlockMetaData(x, y, (byte)curBlockMD); } else{ if(blockLeftMD < curBlockMD){ byte toShare = shareAtATime; if(blockLeftMD + toShare > 100){ toShare = (byte)(100 - blockLeftMD); } if(curBlockMD - toShare < 0){ toShare = (byte)curBlockMD; } curBlockMD -= (byte)toShare; GameServer.setBlockMetaData(x - 1, y, (byte)(blockLeftMD + (byte)toShare)); GameServer.setBlockMetaData(x, y, (byte)curBlockMD); } } } //rightCanReceive = false; if(rightCanReceive){ if(blockRight == 0){ byte toShare = shareAtATime; if(curBlockMD <= shareAtATime){ toShare = (byte)(curBlockMD); } curBlockMD -= toShare; GameServer.setBlock(x + 1, y, 10, true, (byte)toShare); GameServer.setBlockMetaData(x, y, (byte)curBlockMD); } else{ if(blockRightMD < curBlockMD){ byte toShare = shareAtATime; if(blockRightMD + toShare > 100){ toShare = (byte)(100 - blockRightMD); } if(curBlockMD - toShare < 0){ toShare = (byte)curBlockMD; } curBlockMD -= toShare; GameServer.setBlockMetaData(x + 1, y, (byte)(blockRightMD + toShare)); GameServer.setBlockMetaData(x, y, (byte)curBlockMD); } } } } if(curBlockMD <= 0 || curBlockMD > 100){ GameServer.setBlock(x, y, 0, true, 0); return -2; } return 1; }); setBlockWalkThrough(true); setBlockID(10); setBlockName("Water"); setBlockHardness(-1); setBlockRenderSpecial(true); setBlockGetRender((x, y, spriteBatch) =>{ byte blockUp = GameWorld.getBlockIDAt(x, y - 1); byte metaData = GameServer.getBlockMDAt(x, y); Vector2 position = new Vector2(x, y); position *= new Vector2(GameWorld.blockWidth, GameWorld.blockHeight); position += (new Vector2(GameWorld.blockWidth, GameWorld.blockHeight) / 2); position -= CameraManager.cameraPosition; Effect e = AssetManager.GetEffect("WaterLevel"); if(blockUp == 10 && metaData >= 95) e.Parameters["override"].SetValue(true); else e.Parameters["override"].SetValue(false); e.Parameters["height"].SetValue((int)metaData); DrawManager.Draw_Box(position, GameWorld.blockWidth, GameWorld.blockHeight, Color.White, spriteBatch, 0f, 255, e); return null; }); [/csharp] [editline]23rd November 2011[/editline] Fixed it. It was due to sharing to the right and left at the same time while not having enough to share.
[QUOTE=Jack Trades;33400652]What kind of animation editor are you looking for? Bone animations, frame-by-frame animations or some other kind?[/QUOTE] Any kind. I need something I can study, and then try to replicate for my needs. You know, something so I can get an idea how this stuff works. Edit: If anyone also knows an article about this skeletal stuff, please point me to it.
Been working on a planetary game in Love that I'm hoping will eventually end up like a 2D Mario Galaxy. I havn't really gotten any goals or (good looking) visuals done yet due to the fact that I've spent most of my time polishing out movement/gravity, but considering this is my first time using love I'm pretty proud of it. Oh and considering how stupid it is to calculate physics and draw objects in Love I went and made a custom function so that for each planet all I have to do is this: [lua]planet[1] = planet:new( world, 1024/2, 768/2, color.Green, 150 )[/lua] [vid]http://dl.dropbox.com/u/19418211/Untitled.mp4[/vid]
[QUOTE=nick10510;33401408]Been working on a planetary game in Love that I'm hoping will eventually end up like a 2D Mario Galaxy. I havn't really gotten any goals or (good looking) visuals done yet due to the fact that I've spent most of my time polishing out movement/gravity, but considering this is my first time using love I'm pretty proud of it. Oh and considering how stupid it is to calculate physics and draw objects in Love I went and made a custom function so that for each planet all I have to do is this: [lua]planet[1] = planet:new( world, 1024/2, 768/2, color.Green, 150 )[/lua] -vid-[/quote] Sexy.
So, I spend a lot of time working on the command line. However, the place where I work is a .NET shop, and while I _could_ fight to get zsh (the new ones, not the old 3.x builds) to run on Windows, it would be a pita to set everything up. This also doesn't help all that much because of how often I move between machines (I'm in charge of the build systems as well as other tasks, you see :v:) So, I took to getting powershell to be more 'unixy'. Part of that is ensuring you've got a few values set. Such as $EDITOR, or having the msvc toolchain setup on your system path. So I figured I'd show you guys the functions that I've got because so few people use powershell on windows (it's really awesome. verb-nouns and cmdlets are pretty neat!) Anyhow, so the first problem was to change that terrible prompt to literally look like my OS X and Linux shell prompts. Luckily, you can override anything in powershell by way of functions. So all I had to do was write a "prompt" function. [code] function prompt { write-host ('[' + [Environment]::UserName.ToLower() + '@' + [Environment]::MachineName.ToLower() + ']:' + (pwd).Path.Replace($HOME, '~').Replace('\', '/') + '$') -NoNewLine return ' ' } [/code] So, my prompt ends up looking like [username@machinename]:~/$ at startup. There are ways to also change the tab completion to use a forward instead of a backwards slash, but I haven't gotten around to it, as it can get a little tricky as some really old MS utilities always treat forward slashes as argument starts. OK, so this isn't that big of a deal. However, I also need to be able to quickly run a Visual Studio/Windows SDK tool every so often (generation of GUIDs for test installers. This kind of thing happens when you need to interop with shitty COM APIs like Lotus Notes. No I'm not joking, I just finished implementing some interop for us, and oh god it was depressing. There's no true schema to their file format except s-expressions, aka Lisp, and even then it doesn't follow true lisp standards of any kind. ugh. But I digress.), so I need to get the msvc tools on my path. Well luckily there is a batch file that sets up your path, but I might need to send it different tool information, such as "Use MSVC 9 with the amd64 toolchain", and not have to restart my powershell session. So I wrote the following. [code] function set-msvc([int]$version=10, [string]$type="amd64") { $env_var = [String]::Format("VS{0}0COMNTOOLS", $version) $tools = [Environment]::GetEnvironmentVariable($env_var, "Machine") $path = "..\..\vc\vcvarsall.bat" $run = [String]::Format("`"{0}{1}`" {2} & set", $tools, $path, $type) cmd.exe /c $run | foreach-object { $key, $value = $_.Split('=') set-item -path env:$key -value $value } } [/code] Coincidentally, this is almost how my build system worked to get the msvc tools and such on the system path automatically. (I've since decided it was too much work, and some folks may not like a .bat file being generated behind the scenes, so my build system just expects you to have a tool on the system path, and errors out if you don't) I'll not continue posting too much more, as it would end up being a wall of text, so you guys can check out the actual files (and other config stuff like my vim files, as well as the installer that I've got) over at [url=https://github.com/sahchandler/dotfiles]my github dotfiles repo[/url] I figured someone here would be able to get some use out of my configurations. Powershell is pretty neat though! If there were a python-like shell that worked in the same way (cmdlets of verb-nouns that run python functions), I'd probably end up using that. But I'm sure as hell not writing it :v:
[QUOTE=Jack Trades;33400552]3D animation is going to be the death of me one day. Even a simple running cycle requires lots of time and focus to details. [img_thumb]http://i.imgur.com/lkUQP.jpg[/img_thumb][/QUOTE] How are you planning to export the rigging information? I'm curious because I found it necessary to modify the blender .obj export script to include bone definitions. Are you using .fbx?
[QUOTE=RyanDv3;33402211]How are you planning to export the rigging information? I'm curious because I found it necessary to modify the blender .obj export script to include bone definitions. Are you using .fbx?[/QUOTE] Game engine I'm using has a built-in support for .fbx importing.
git push origin master ^C^C^C^C^C Well, I guess I fucked it all up.
Is there some construct sort of like a queue or a stack (I know they are different things) which works the exact same way, except that when popping/dequeueing no items are actually removed, but a (resettable) index variable is incremented instead? Or do I have to make one myself?
[QUOTE=bobthe2lol;33402675]Is there some construct sort of like a queue or a stack (I know they are different things) which works the exact same way, except that when popping/dequeueing no items are actually removed, but a (resettable) index variable is incremented instead? Or do I have to make one myself?[/QUOTE] Surely you can just create a Tree of some kind and use a runner to navigate its nodes without affecting it? (This is coming from extreme noob knowledge in this area, thought I'd give it a shot)
[QUOTE=nick10510;33401408]Been working on a planetary game in Love that I'm hoping will eventually end up like a 2D Mario Galaxy. I havn't really gotten any goals or (good looking) visuals done yet due to the fact that I've spent most of my time polishing out movement/gravity, but considering this is my first time using love I'm pretty proud of it. Oh and considering how stupid it is to calculate physics and draw objects in Love I went and made a custom function so that for each planet all I have to do is this: [lua]planet[1] = planet:new( world, 1024/2, 768/2, color.Green, 150 )[/lua] [vid]http://dl.dropbox.com/u/19418211/Untitled.mp4[/vid][/QUOTE] Are you using images or love.graphics.circle for the planets?
-snip- I'm not even going to [i]try[/i] and explain what happened there.
[QUOTE=bobthe2lol;33402675]Is there some construct sort of like a queue or a stack (I know they are different things) which works the exact same way, except that when popping/dequeueing no items are actually removed, but a (resettable) index variable is incremented instead? Or do I have to make one myself?[/QUOTE] I would just use an array or a list if it doesn't have a fixed length, then implement the index variable yourself. However, if the item type you want to work with is something like bytes or ints then you could use a stream.
Question: When I use malloc() or 'new' to allocate some small amount of memory, am I really wasting like 4kb when asking for 4 bytes? Can I make lots and lots of pointers to 8-256 bytes of memory each, RAM-efficiently? If not, what's the best thing to do when you need lots of small pointed numbers?
[QUOTE=Nikita;33403127]Question: When I use malloc() or 'new' to allocate some small amount of memory, am I really wasting like 4kb when asking for 4 bytes? Can I make lots and lots of pointers to 8-256 bytes of memory each, RAM-efficiently? If not, what's the best thing to do when you need lots of small pointed numbers?[/QUOTE] Try it. If performance sucks you have your answer. If not you successfully avoided wasting time.
[QUOTE=Nikita;33403127]Question: When I use malloc() or 'new' to allocate some small amount of memory, am I really wasting like 4kb when asking for 4 bytes? Can I make lots and lots of pointers to 8-256 bytes of memory each, RAM-efficiently? If not, what's the best thing to do when you need lots of small pointed numbers?[/QUOTE] It sounds like you should probably be approaching the problem from another angle...
[QUOTE=Nikita;33403127]Question: When I use malloc() or 'new' to allocate some small amount of memory, am I really wasting like 4kb when asking for 4 bytes? Can I make lots and lots of pointers to 8-256 bytes of memory each, RAM-efficiently? If not, what's the best thing to do when you need lots of small pointed numbers?[/QUOTE] Why would you waste 4kb? It only allocates as much as you want it to afaik.
[QUOTE=Robbis_1;33403612]Why would you waste 4kb? It only allocates as much as you want it to afaik.[/QUOTE] Memory space fragmentation and OS overhead. You don't 'magically' get heap memory, the OS has to figure out where to take it from and then keep track of it.
Allocate a larger pool of memory, then get pointers every 4 bytes from the beginning?
[QUOTE=ROBO_DONUT;33403788]Memory space fragmentation and OS overhead. You don't 'magically' get heap memory, the OS has to figure out where to take it from and then keep track of it.[/QUOTE] Yes, that is true, but his program only gets the amount of bytes he asked for. Anyway, do like esalaka said, you can create your own memory pool if you really need it. Then you allocate a bigger chunk of memory, say 1MB and then let your own code give you pieces.
Oh, the joys of C#. No need for memory mangement.
[QUOTE=Nikita;33403127]Question: When I use malloc() or 'new' to allocate some small amount of memory, am I really wasting like 4kb when asking for 4 bytes? Can I make lots and lots of pointers to 8-256 bytes of memory each, RAM-efficiently? If not, what's the best thing to do when you need lots of small pointed numbers?[/QUOTE] Use new and let your compiler worry about it.
[QUOTE=Yogurt;33404347]Oh, the joys of C#. No need for memory mangement.[/QUOTE] Just because of that comment, I'm going to put you in my monthly game entry.
[QUOTE=Soviet_Banter;33404502]Just because of that comment, I'm going to put you in my monthly game entry.[/QUOTE] I'm scared.
[QUOTE=Yogurt;33404527]I'm scared.[/QUOTE] Good. ;)
[hd]http://www.youtube.com/watch?v=-K-81tjcpE8[/hd] [editline]23rd November 2011[/editline] Sorta finished with my beat detection. It's actually good enough that I can put it aside and work on my website right now. The frame capture rate doesn't accurately show how well the beat detection is, unfortunately. I couldn't be bothered to put fraps on my netbook and record it from there. Using my textured logo for this stuff, looks nice I think: [IMG]http://i.imgur.com/qv2SA.png[/IMG] From: [IMG]http://i.imgur.com/rX80A.png[/IMG]
[media]http://www.youtube.com/watch?v=Wn5X6WGVzS0[/media] Woo! Worked on more features, including: -3d positional sound through OpenAL -Particle system (w/depth sorting) -Machine gun fire control system (group weapons to one fire key), spread, and hit detection -Finer ability to control pitch (for aiming, increases either the front or back hover distance for a stable firing platform) -Resource management system (sounds, textures, models are only loaded once from the disk) I need to work on volume normalization - can barely hear the explosions. Also, gotta make some new sprites for explosions and re-add coloring to the shader. This art will do for now, though. Sorry for the horrible resolution. The only reason I was able to render at 1080p last time was because I scaled time by 0.25, but I couldn't do that this time as I have yet to implement audio speed scaling. I did eliminate the file system bottleneck by creating a ram disk with ImDisk, but my E6600 can't keep up. The game has no problem running at 60 FPS without recording software. I should probably optimize the terrain heightmap system...
[QUOTE=Yogurt;33404347]Oh, the joys of C#. No need for memory mangement.[/QUOTE] The difference is, you can worry about this sort of thing in lower level languages but you don't have to. The option is always there.
Sorry, you need to Log In to post a reply to this thread.