C# using Winforms.
Example of the transparency
[img_thumb]http://gyazo.com/169bc3174fb7aebfa0acb9965ffd5967.png[/img_thumb]
[QUOTE=Overv;28554347]Do you guys like the concept of making a class with all of an application's functions and variables and creating an instance of that in the entry point function or do you prefer the 'regular' way?[/QUOTE]
Kinda late, but I don't like that way because it makes it seem like you can create multiple instances of your program within a single program, which doesn't make sense. Alternatives are making all the members of the class static, or not using a class and using a namespace instead. I use the namespace way most often.
so I opened up my level editor again, trying to add a few more features before calling it done. Realized that most of the level editor was in a single form file, split up into 4 partial classes. I could just rewrite it all in a much more organized way, or I could just tack a few more methods in here and it'll have almost identical functionality...
Too close to release for a rewrite, but at least I know what NOT to do next time... anyways, here's the latest feature, triggers, and I spent a while wrapping my head around UITypeEditor to get that dropdown list to work properly and display the entity list.
[img]http://i.imgur.com/8qzsg.png[/img]
(also, I had to align the dropdown manually in photoshop because alt-prntscrn would only take a screenshot of the dropdown and not the entire form, if you're wondering why it's probably off by a pixel or two)
holy shit my bot actually does something now
[img]http://dl.dropbox.com/u/5733962/batallion/batallionprogress20110311fortune.png[/img]
I also implemented exception handling. Totally coincidental. Yeah.
[img]http://dl.dropbox.com/u/5733962/batallion/batallionprogress20110311exceptionhandling.png[/img]
[cpp]
Terrain::Terrain(const std::string& Filename) : m_BlockUVs(0)
{
if(!m_InternalTexture.LoadFromFile(Filename))
throw new std::exception("Failed to load the terrain texture.");
unsigned char Blocks = (m_InternalTexture.GetWidth() / Terrain::BlockSize) * (m_InternalTexture.GetHeight() / Terrain::BlockSize) - 1;
m_BlockUVs = new sf::FloatRect[Blocks];
for(unsigned int i = 0; i < Blocks; ++i)
{
int x = i & (Terrain::BlockSize - 1);
int y = (int)((float)i / Terrain::BlockSize);
x *= Terrain::BlockSize;
y *= Terrain::BlockSize;
m_BlockUVs[i] = m_InternalTexture.GetTexCoords(sf::IntRect(x, y, Terrain::BlockSize, Terrain::BlockSize));
}
}
[/cpp]
* Vomits in mouth.
I really need to clean my code up, on the bright side: I've got Minecraft blocks rendering.
[QUOTE=DevBug;28559811]I really need to clean my code up[/QUOTE]
yeah, you can start with the hungarian notation
[QUOTE=Bang Train;28553468][img_thumb]http://content.screencast.com/users/train/folders/Jing/media/f4bb7476-96b4-4bbb-9951-8de702c47b16/2011-03-11_2008.png[/img_thumb]
that doesnt look right....[/QUOTE]
Thats a Sync issue, i forgot to deflate the chunk before resending, you see the corners are water, those got synced correcly, i just fixed it:P
and woa, you realy had to draw a 3d arrow? xD
It's not 3D.
2D with dropshadow. :v:
[QUOTE=~ZOMG;28560577]It's not 3D.[/QUOTE]
Fine,
Why did you draw a FANCY arrow that has a SHADOW, wasnt just a line whit a arrowhead enough?
Because you deserve such a fancy arrow?
[QUOTE=eXiv2;28560646]Because you deserve such a fancy arrow?[/QUOTE]
Programmer love :3:
Been working on an RSS Reader and wanted to integrate Windows Live ID Authentication
Progress:
[img]http://ahb.me/26YT[/img]
[img]http://ahb.me/26YW[/img]
All the feed posts are cached in MySQL so if 100 people subscribe to the same feed, it only stores the posts once.
[QUOTE=Overv;28554347]Do you guys like the concept of making a class with all of an application's functions and variables and creating an instance of that in the entry point function or do you prefer the 'regular' way?[/QUOTE]
I always do it the class way. It's just so much nicer.
[QUOTE=Jallen;28563484]I always do it the class way. It's just so much nicer.[/QUOTE]
You stay classy, San Diego.
500.000 and 5fps :O
[media]http://img232.imageshack.us/img232/9650/screenshotykf.png[/media]
how do you keep your fps at a good speed jallen? only thing i can think of is limiting the particles
Trying to make a tile based game (think the way pokemon works when you're not in battle). Got the map loading to work (it loads grids of integers from text files):
[code]MAP LOAD SUCCESSFUL!
00000000000
00001110000
00011111000
00110101100
00111111100
00110001100
00011111000
00001110001
00000000000[/code]
Hooray! As usual though, there's probably a million ways I should be doing this that I'm not.
Also I know this is basic but I've been struggling getting this to work for a bit and I'm relieved now - I kept using the opposite values for height and width and it all just became a big mess.
[editline]12th March 2011[/editline]
[QUOTE=Richy19;28563908]500.000 and 5fps :O
[media]http://img232.imageshack.us/img232/9650/screenshotykf.png[/media]
how do you keep your fps at a good speed jallen? only thing i can think of is limiting the particles[/QUOTE]
When will you ever need 500,000 particles? I don't think jallen's android app ever has that many (if a. that's what we're talking about and b. it's not changed drastically since the last time I came to the WAYWO)
Got it at least to a working state again:
[media]http://www.youtube.com/watch?v=dRRCIspv03I[/media]
[QUOTE=s0ul0r;28564041]Got it at least to a working state again:
[media]http://www.youtube.com/watch?v=dRRCIspv03I[/media][/QUOTE]
Nice, are you using XNA for this?
[QUOTE=Richy19;28564391]Nice, are you using XNA for this?[/QUOTE]
jup.
Haha, I love how you can raise and lower the terrain like that.
Holy shit, my post count! Noooooo
[QUOTE=Richy19;28563908]500.000 and 5fps :O
[media]http://img232.imageshack.us/img232/9650/screenshotykf.png[/media]
how do you keep your fps at a good speed jallen? only thing i can think of is limiting the particles[/QUOTE]
Well
a. You will never need 500,000 particles.
b. If you ever wanted that many particles, it would be better suited to a GPU to process.
My android one has pretty low caps as the masses massively increase the amount of calculations to be done.
If you think about it, 1000 particles and no masses is just some addition of vectors.
1000 particles and 1 mass is the calculation of the masses effect on each particle, so 1000 grav accel calculations (that includes sqrt for accurate distance measuring)
1000 particles and 20 masses is 20,000 grav accel calcuations.
I have a timestep of 25ms on my app, which means that for 20 masses and 1000 particles it would need to do 800,000 calculations of gravitational acceleration per second.
Double the amount of masses to 40 and you're looking at 1.6 million grav accel calculations per second.
So I capped it.
You either cap it or lose some accuracy of the sim. You could split the area up into a quadtree and calculate the gravitational acceleration for every particle in a given square or something, that may be relatively unnoticeable, I haven't really played around with trying to do any fancy optimisations though.
I just noticed how ridiculously simple du/dv mapping is. In fact, I just implemented it in my game. Here's the shader code.
[cpp]uniform sampler2D texture;
uniform sampler2D normalmap;
void main()
{
vec2 pos = gl_TexCoord[0].xy;
vec4 normal = texture2D(normalmap, pos);
pos.x += normal.r - 0.5;
pos.y += normal.g - 0.5;
vec4 tempcol = texture2D(texture, pos);
gl_FragColor = tempcol;
}[/cpp]
That's it! Now you have du/dv mapping! To make your average normal map work for this, simply invert it.
[QUOTE=bobthe2lol;28564622]Haha, I love how you can raise and lower the terrain like that.
Holy shit, my post count! Noooooo[/QUOTE]
That is one incredibly complex vertex shader, you wouldn't understand it.
<3
Update on my image viewer:
[img_thumb]http://gyazo.com/35eed5d1102e3518d7f3efd0287a5b9d.png[/img_thumb]
Shows file size, image dimensions, format and screen size (of the application) plus zoom works a little better. I think I'll make it work by percents..
[editline]666[/editline]
Changed the background for transparency
[img]http://gyazo.com/402f6090304dde80c6ec79c541f57bd3.png[/img]
[QUOTE=Apple Pi;28554327]I'll stare as long as they look nice :)
[highlight](User was banned for this post ("Spamming dumb ratings on CarlBooth" - SteveUK))[/highlight][/QUOTE]
About time.
So I made a quick note script on the side.
[img]http://dl.dropbox.com/u/5733962/notescript.png[/img]
[url=http://filesmelt.com/dl/notescript.py]You can download it here[/url]. Just edit ~/.notes with one note per line and add the script to your .bashrc file.
(fortune not included)
[img]http://puu.sh/1ccD[/img]
THis happens if you fuck up your drawing code. It looks harmless for now.
[QUOTE=s0ul0r;28565240]That is one incredibly complex vertex shader, you wouldn't understand it.
<3[/QUOTE]
Getting rated dumb for an obvious joke, oh facepunch...
Sorry, you need to Log In to post a reply to this thread.