ratings described it in one click
ratings described it in one click
I would really like that for my G15. Can you share it already?
I think that's where the artistic ratings came from. Let's face it, red blocks are pretty but they just don't compare to the character.
A real software engineer would have used a database to store the worlds. Realising that a database is optimised for spatial data fetch from large arrays of data... Instead notch wrote this massive tree of binary files that are alphabetically named :S... also he seems to store the entire game session in RAM rather than streaming only the surrounding areas into ram?
I'm pretty sure MC started as a learning project for Notch, and only the surrounding chunks are loaded into the RAM.
efficiency RePrEsEnT!
Also yeah binary tags for every block and entity is ofc efficient
If only the surrounding blocks are loaded then the game has NO EXCUSE for using nearly half a gigabyte of ram...
You have notch putting tons of things other than the blocks/entities in memory to thank for that. Also, garbage collection seems to fail in minecraft.
I'm surprised it still runs quickly enough :V:
(not trying to bash on notch but i think he should efficientize his code)
Is there a situation where garbage collection doesn't fail?
It's a "famous" character, Pico, so he may have used a spritesheet or something. Or he's just a good artist/animator.
Here's a screenshot of a level in the game that has graphics:
The guy that does the graphics for my games is awesome :D.
No free spritesheets are that good.
level editor powers go
Besides that's obviously vector animation.
http://dl.dropbox.com/u/11782997/BSPG15Plugin.rar
Just stick it in your BSplayer\plugins folder. No source included, since it's a mess, sorry. You might need the VC10 Redistributable Package for this to work.
Artistic means you aren't really sure what's happening
WAYWO from about a year ago posted:
wat
Why would you use an RTT for every single control? You would only use it for container controls.
Here is something me and a friend done you might be interested in: https://github.com/dzamkov/OpenTKGUI
![]()
Is it me or is this too.. .. .. huge?
It depends on what you're using it for but he most important thing is that it's all in the same huge style.
It's purely just a development theme, you can change it easily by editing this:
https://github.com/dzamkov/OpenTKGUI...kinDefault.png
And these:
https://github.com/dzamkov/OpenTKGUI...ase/Containers
https://github.com/dzamkov/OpenTKGUI...lease/Controls
Hitched up NSTask, NSException, and NSTimer.
I thought he used else ifs over switch statements. But I was wrong. I take back everything I've ever said about Notch chaining else-ifs instead of using switches.
Turns out he just uses a sequence of ifs
Code:public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) { if(l == 0 && minY > 0.0D) { return true; } if(l == 1 && maxY < 1.0D) { return true; } if(l == 2 && minZ > 0.0D) { return true; } if(l == 3 && maxZ < 1.0D) { return true; } if(l == 4 && minX > 0.0D) { return true; } if(l == 5 && maxX < 1.0D) { return true; } }
An if .. else if ... structure would not provide any benefit in this case.
That's not too bad. It's easier to read than one giant if statement and I'm sure the JIT compiler optimizes it to have about the same performance.
For the exit of the block of the first if, wouldn't the compiler make an optimization to jump to the end of the chain?
Regardless, it is wrong to say "Notch uses else-ifs over switch statements," is it not?
I hope you're right; it's called 6 times per block per visibility check.
Edit:
Oh god...
I really hope you're right.Code:public boolean renderBlockByRenderType(Block block, int i, int j, int k) { int l = block.getRenderType(); block.setBlockBoundsBasedOnState(blockAccess, i, j, k); if(l == 0) { return renderStandardBlock(block, i, j, k); } if(l == 4) { return renderBlockFluids(block, i, j, k); } if(l == 13) { return renderBlockCactus(block, i, j, k); } if(l == 1) { return renderBlockReed(block, i, j, k); } if(l == 6) { return renderBlockCrops(block, i, j, k); } if(l == 2) { return renderBlockTorch(block, i, j, k); } if(l == 3) { return renderBlockFire(block, i, j, k); } if(l == 5) { return renderBlockRedstoneWire(block, i, j, k); } if(l == 8) { return renderBlockLadder(block, i, j, k); } if(l == 7) { return renderBlockDoor(block, i, j, k); } if(l == 9) { return renderBlockMinecartTrack(block, i, j, k); } if(l == 10) { return renderBlockStairs(block, i, j, k); } if(l == 11) { return renderBlockFence(block, i, j, k); } if(l == 12) { return renderBlockLever(block, i, j, k); } else { return false; } }
...and for the record, I am seeing "switch" in the source output for some classes, so the compiler he's using does use the switch opcode.
Wait, does that mean he "builds" the mesh every frame? I wonder if he's using immediate mode...
No, that's impossible. The performance is awful, but it's nowhere near as awful as it would be with immediate mode.
I wonder why he just doesn't put the render code in the child classes and call a single render method for the parent Block object (all the blocks extend the main Block class). Is there some penalty for importing the stuff for rendering in the block classes?
Maybe the dispatch code for overriding methods is slower? I'd be like "fuck that we're doing object oriented programming up in this bitch." Then again, wouldn't that dispatch code just be a switch of some sort?
Perhaps having all the render code in one file is smarter?
Maybe Notch is a bad coder?
No, he isn't.
He can't be using VBOs though, or if he is, he's uploading the mesh every frame. In a little technical demo I made, I have 16x16x16 chunks that extend infinitely in every direction, generated by 3d perlin noise - each chunk compiles itself in a seperate thread to the rendering thread, then uploads itself to a VBO. When it's time to draw, it's just a simple case telling opengl to render the vbo. I can have render distance much higher than minecraft to achieve the same framerate, although it's not a very fair test as I don't have lighting or networking or any kind of entities implemented - I doubt those things would affect performance much though. Notch seems to be building the mesh every frame.
l remember reading somewhere that he uses glDrawArrays, which makes sense. Though I don't know his chunks seam to build pretty damn fast, for lighting and water physics to look good.
Lighting is just a basic form of 3d lightmap, predicted by the server (badly) then done properly by the client (nothing like computing the same thing twice, eh). It's then applied using glColor3f, or the glDrawArrays equivalent (glColorPointer or something). Water physics is just a little algorithm to determine where the water should flow, and then setting block IDs and metadata as appropriate - the standard rendering process deals with the rest.
Edit:
Here's a picture of my little demo, it took me about 4 days to get that to work - although the first three days were spent screwing around with openTK trying to make it work with SFML. (I didn't, I ended up scrapping SFML - so I can't put an FPS label up since I can't find a GUI library for openTK)
Would this be a valid technique to use or is there something better?
Also, I need to dedicate my 1,000th post to something.
I can't think of another way of doing it, the standard opengl lighting model isn't going to cut it and I don't know if you can achieve the same effect with a vertex shader.
Edit:
It should be 100% clientside though.
What if the obfuscator did that?
It doesn't really matter. An if else sequence is identical to a sequence of straight if statements in this case. Not sure why it's such a big deal.
For some reason, I'm finding user interface programming to be quite fun.
An inventory screen. You can move around, but there are no items yet, so it's not much use yet.
A new minor screen: the popup. In this case, I use it with some functions for the world to check whether all the tiles have been explored.
All the logic is being done entirely in Lua. Even with just the dialog and input screen, I made a working bank (not shown) as well a mini-quest to wire money from one bank to another. I love Lua.
Is that written in C++?
If so, what are you using to integrate it with Lua?
Edited:
And you should probably correct rougelike to roguelike, it's been like that for ages. D:
:neckbeard: 1,000th post dedicated to WAYWO.
It is written in C++ with SFML. I'm using just the Lua library itself. At first, I tried LuaBind, but I found it too confusing and there was little to no documentation on it. I bought the Programming in Lua book and have been reading and experimenting with that the past month.
And wow, I feel like an idiot for not noticing the misspelling in the name for months now.
Everyone that releases something could be accused of being a bad coder. Because they were too busy actually releasing stuff to obsess over the state of their code.
It doesn't matter that your 50 line program is awesomely coded because you're never gonna release it - you're going to recode it over and over again.. obsessing that your code is messy.