• What are you working on? v15
    5,001 replies, posted
[img]http://i.cubeupload.com/QDOFmN.png[/img]
[QUOTE=Dr Magnusson;27270192][img_thumb]http://i.cubeupload.com/QDOFmN.png[/img_thumb][/QUOTE] It seems that you haven't defined A or B. In that case your language SHOULD assume A and B are equal, since A and B are both null/undefined.
That is true, but right now all the operator functions are just placeholders, till I can incorporate "metatables" Well there you go. I made the comparison function also work correctly for nil values, and as a result efeX is no longer a pretty cool guy.
[QUOTE=iRzilla;27270723]Please make a ambient occlusion shader.[/QUOTE] What...?
[QUOTE=Dr Magnusson;27270497]That is true, but right now all the operator functions are just placeholders, till I can incorporate "metatables" Well there you go. I made the comparison function also work correctly for nil values, and as a result efeX is no longer a pretty cool guy.[/QUOTE] :(
That grass annoys the shit out of me.
[QUOTE=ZenX2;27267946][editline]7th January 2011[/editline] SHIT, earthquake here in california [editline]7th January 2011[/editline] I'm still shaking[/QUOTE] Reminds me of [img]http://imgs.xkcd.com/comics/seismic_waves.png[/img] Sorry for being off-topic, I just had the sudden urge to inform people on what I was thinking.
-snip-
[QUOTE=iRzilla;27270937][img_thumb]http://boards.fightingamphibians.org/mc/src/128874451941.gif[/img_thumb][/QUOTE] looks like a clever vertex color technique.
I hope notch is going to release details about the new save format for Minecraft so we don't have to reverse engineer it.
[QUOTE=layla;27271133]That grass annoys the shit out of me.[/QUOTE] The sand, grass, dirt and rock look like the same texture, but with a different hue imo.
[QUOTE=deloc;27273385]looks like a clever vertex color technique.[/QUOTE] It can be done with vertex shaders or lightmaps if all the lighting is precalculated and nothing moves, but that's not suitable for most games. The most common way to do it (afaik) is [url=http://en.wikipedia.org/wiki/Screen_Space_Ambient_Occlusion]SSAO[/url], which is a post-processing step done with a pixel shader.
[QUOTE=yakahughes;27266568]If you had a struct, such as: [cpp] struct Color { int r; int b; int g; };[/cpp] It would be, in memory, the exact same as an array of 3 ints. So it won't be any different, except a class is simpler and more understandable to use (clr.g instead of clr[2]) and is neater in my opinion. [/QUOTE] iirc, you can do this: [cpp] struct { float r, g, b; } color[] = { {1,0,0}, //red {0,1,0}, //green {0,0,1}, //blue }; [/cpp] And in order to access a color like red, you would set the rgb values to color[0].r, color[0].g and color[0].b respectively. I find this as an easy way to index while doing colors. You can also further this by adding and enumerator so that you can use color[RED].r, color[RED].g and color[RED].b instead. Automerge :S
Took a break from my main project to try out an idea I had: JavaScript multiplayer game. It worked out... kinda. You can try it (using Chrome preferably): [url]http://www.alexturpin.net/ajaxtest/[/url] Arrow keys to move. You're the blue guy. Of course there's a lot of latency seeing as this is HTTP, and you have to go check if there are any updates for you seeing as you can't directly "receive" stuff. I think it could work for a slow-paced game, maybe turn-based like chess or such.
Storing colors as floats or ints is kinda ridiculous though, store them as chars.
[QUOTE=Dr Magnusson;27276298]Storing colors as floats or ints is kinda ridiculous though, store them as chars.[/QUOTE] That's annoying me, stop calling the byte a char, yes I know they are the same but a char is used in the context of strings.
Nobody's mentioning a byte. Chars might not even be bytes, it depends on the platform you're on.
[QUOTE=dag10;27269614]Quick question: In C++, what is the easiest way to store, in an individual header file, the list of tile types in the game? Each tile type would have to have a tile ID, tile name (c string), it's X offset in the tileset image, it's Y offset, it's width, and its height. More specifically, what is the syntax to do this? I don't want to be allocating an array with this information at runtime, so it needs to be static. [editline]8th January 2011[/editline] It would also have to store it's RGB color value (either as an integer, 3 chars, or an sf::Color if possible) of it's reference pixel in the level image. As in, here's what the level looks like: [img_thumb]http://i.imgur.com/Ta2Gt.png[/img_thumb] So it needs to store what color value of pixels in the level image should be a specific tile.[/QUOTE] [cpp]struct Tile{ ... }; const static Tile tileVector[] = { Tile(...), Tile(...), Tile(...), ... };[/cpp]
[QUOTE=Jookia;27276522]Nobody's mentioning a byte. Chars might not even be bytes, it depends on the platform you're on.[/QUOTE] Well, as seen as most images are 24bit, that is 3 bytes per pixel. So you would use a byte, you wouldn't use anything more than the size of a byte so I assumed his char is a 1 byte char.
I did mean bytes, I should've been more specific.
I completely forgot to post this but I finished my program which extracts all the artistic pictures from the Minecraft threads. It puts all of them in the little tiled component to the left. Clicking on an individual thumbnail allows you to see a blowup of the picture on the right. Clicking on the blowup takes you to that post in the thread! I'll probably modify it to be a more generic program so someone can pick the thread and rating they want to look for (for example, heart ratings in the LMAO thread). [img_thumb]http://filesmelt.com/dl/mctp.png[/img_thumb] Otherwise, the memory usage sucks, because most of components that come with Flash suck. Each time an image is loaded into the TileList component, it loads the entire image to generate the thumbnail. I'll try to figure out a way so that only a small version of the image is used to generate the thumbnail instead of caching the entire image. Additionally, the Flash garbage collector is a pile of shit (teehee) that doesn't know how to properly deallocate memory, so I may need to rewrite some of the code so that it works better. Finally, the components have awful UI controls. Maybe I'll redesign those at some point. You can download it here: [url]https://sites.google.com/site/hueythefreeman/files[/url]
[QUOTE=COBRAa;27274142]I hope notch is going to release details about the new save format for Minecraft so we don't have to reverse engineer it.[/QUOTE] Notch is changing the format? Does that include a new format for chunks and the like? If so, I'm glad I've been putting off writing an interface for them :v:
[QUOTE=raBBish;27277053]Notch is changing the format? Does that include a new format for chunks and the like? If so, I'm glad I've been putting off writing an interface for them :v:[/QUOTE] Yes, It's on his blog, well he mentions it as a priority but he works in Valve time so. [editline]8th January 2011[/editline] [QUOTE=Dr Magnusson;27276846]I did mean bytes, I should've been more specific.[/QUOTE] No problem.
[QUOTE=COBRAa;27277392]Yes, It's on his blog, well he mentions it as a priority but he works in Valve time so. [/QUOTE] No, it's Mojang time.
I don't really see minecraft going anywhere right now as long as it stays on Java.
Finished a little mockup of my Facepunch for Android app. With the current design, you will be able to reply and rate by holding down your finger on a post and using a popup menu. [img]http://www.imgdumper.nl/uploads3/4d27f4e23d9ad/4d27f4e233982-Facepunch_android_mockup_device_small.png[/img]
[QUOTE=COBRAa;27276442]That's annoying me, stop calling the byte a char, yes I know they are the same but a char is used in the context of strings.[/QUOTE] However, a char is the smallest unit of memory usable in C-derivative languages (Unless you count some bool optimizations) and is always of size 1, so while some platforms might have a char that is not 8 bytes, it would still be the smallest type of a variable you could have. Hence, it is perfectly valid to say to save them as chars. Although I would prefer unsigned chars.
[QUOTE=Overv;27278107]Finished a little mockup of my Facepunch for Android app. With the current design, you will be able to reply and rate by holding down your finger on a post and using a popup menu. [img_thumb]http://www.imgdumper.nl/uploads3/4d27f4e23d9ad/4d27f4e233982-Facepunch_android_mockup_device_small.png[/img_thumb][/QUOTE] I'de buy it. [editline]8th January 2011[/editline] [QUOTE=esalaka;27278247]However, a char is the smallest unit of memory usable in C-derivative languages (Unless you count some bool optimizations) and is always of size 1, so while some platforms might have a char that is not 8 bytes, it would still be the smallest type of a variable you could have. Hence, it is perfectly valid to say to save them as chars. Although I would prefer unsigned chars.[/QUOTE] I see, also, might want to clean up that 8 bytes problem, my OCD doesn't like it :(
I know that there is a help thread but I never got any help there. Can somebody just help me real quick with this: [code] if(username.equals(u1)){ do stuff else do other stuff } [/code] A very basic IF statment. The thing is, can I make it so that it checks if username.equals several different things? I got three usernames and I want to check them all, so it is basically like if username.equals(u1, u2, u3); Is this possible? So that I don't have to write multiple if statements.
[QUOTE=CommanderPT;27278687]I know that there is a help thread but I never got any help there. Can somebody just help me real quick with this: [code] if(username.equals(u1)){ do stuff else do other stuff } [/code] A very basic IF statment. The thing is, can I make it so that it checks if username.equals several different things? I got three usernames and I want to check them all, so it is basically like if username.equals(u1, u2, u3); Is this possible? So that I don't have to write multiple if statements.[/QUOTE] [code] if(username.equals(u1)) { // do stuff } else if(username.equals(u2)) { // do more stuff } else if(username.equals(u3)) { //do this } else { //do default crap }[/code]
Sorry, you need to Log In to post a reply to this thread.