Havn't posted in here in a while. Happy Australia day everyone (thats right we have our own day). Going to a beach house for a few days, i'll post a screenshot from a normal map implementation when I get back.
[QUOTE=The Inzuki;19854312][media]http://www.youtube.com/watch?v=wIqgFRfMov4[/media]
First game I've ever made in C++ with Allegro. I feel proud :D
[/QUOTE]
Hey that's pretty cool, nice animation (might want to run it a bit faster or something so it looks smoother) :D Maybe you can pop up objects in random spots and tell the player to go get them or something :v:
BTW, guys, it's called right-click->open-image-in-new-tab and your browser will resize it to fit :downs: That or lets not use images, in case someone is reading this on a text-based browser.
[QUOTE=r4nk_;19859029]Happy Australia day everyone (thats right we have our own day).[/QUOTE]
Most if not all countries do ;)
That said, hope you enjoy it, as it usually means a day off and some partying over here.
[QUOTE=nullsquared;19860699]Hey that's pretty cool, nice animation (might want to run it a bit faster or something so it looks smoother) :D Maybe you can pop up objects in random spots and tell the player to go get them or something :v:
BTW, guys, it's called right-click->open-image-in-new-tab and your browser will resize it to fit :downs: That or lets not use images, in case someone is reading this on a text-based browser.[/QUOTE]
post 1.
let's all take bets on how long he can last.
[highlight](User was banned for this post ("Don't push your / his luck" - birkett))[/highlight]
Yay, small and stupid accomplishment of finishing SFML Window Framwork, smaller, and just a tad more powerful.
[cpp]
#include "CWindow.h"
int main()
{
cf::CWindow Game( "Game Window", 800, 600 ); // Optional Fullscreen Parameter
while(Game.Go())
{
Game.CatchEvents();
Game.Begin(); // Optional Color Parameter
Game.End();
}
}
[/cpp]
[QUOTE=pleb;19861119]post 1.
let's all take bets on how long he can last.[/QUOTE]
Why don't you just slap him in the face and call him a dick.
By which I mean, why the hell are you trying to stir shit? Your comment is as bad or worse than nullsquared's less appreciated posts.
Is it just me or is XPath unnecessarily complicated?
SQL:
[code]
SELECT DISTINCT Cities FROM MyTable WHERE Country = "UK";
[/code]
Will give you a list of all the unique Cities in the UK where some cities have multiple entries. (For example, a holiday booking system or some shit)
XPath:
[code]
/Root/Record[Country="UK" and not(Cities=preceding-sibling::Record[Country="UK"]/Cities)]/Cities
[/code]
Why can't they just make life simple?!
[QUOTE=Jallen;19862721]Why don't you just slap him in the face and call him a dick.
By which I mean, why the hell are you trying to stir shit? Your comment is as bad or worse than nullsquared's less appreciated posts.[/QUOTE]
It's pleb/flair, what do you expect?
Hm I'm thinking about coding octree functuality in my raytracer, since loading f.e. a rubber duck from an .obj file, it tages AAAGES rendering, especially with Ambient occlusion...
[QUOTE=s0ul0r;19865571]Hm I'm thinking about coding octree functuality in my raytracer, since loading f.e. a rubber duck from an .obj file, it tages AAAGES rendering, especially with Ambient occlusion...[/QUOTE]
Yeah definitely, I need to look into some spacial optimization too, hm... :raise:
BTW, you inspired me to do some AO
[img]http://img341.imageshack.us/img341/6753/aoshot.png[/img]
[QUOTE=nullsquared;19865666]Yeah definitely, I need to look into some spacial optimization too, hm... :raise:
BTW, you inspired me to do some AO
[img]http://img341.imageshack.us/img341/6753/aoshot.png[/img][/QUOTE]
Antialiasing. Use it
I believe he's just showing the AO, AA is rather unnecessary.
[editline]03:20PM[/editline]
This isn't the final render for a game/ movie whatever, it's just a demonstration
I'd like to say that I'm glad you're back nullsquared; you know your shit, even if you have a funny way of showing it
:smile:
[QUOTE=ryandaniels;19865934]AA is rather unnecessary.[/QUOTE]
But it makes things all pretty like!
got myself a console
[IMG]http://i49.tinypic.com/14nppgo.png[/IMG]
it does argument highlighting and auto-completes your input if you press tab and stuff
[QUOTE=turby;19866099]But it makes things all pretty like![/QUOTE]
Yeah I'm gonna do some AA eventually b/c it does look nice and it's a good exercise, but it wasn't really the idea of the screenshot I posted :v:
[editline]05:32PM[/editline]
[QUOTE=NovembrDobby;19866155]got myself a console
[IMG]http://i49.tinypic.com/14nppgo.png[/IMG]
it does argument highlighting and auto-completes your input if you press tab and stuff[/QUOTE]
Hey that's pretty cool :smile: How do you parse the commands and their parameters?
[QUOTE=nullsquared;19866202]Hey that's pretty cool :smile: How do you parse the commands and their parameters?[/QUOTE]
Thanks. For most commands (argument-less ones) I just have a string bound to a function that calls it if that string is entered.
For the rest I just use a short switch statement that takes the input string and does something more specific by (normally) splitting the string up into arguments.
It's pretty cobbled-together really but hey, it's a dev console.
During the last couple of days I have written an entity system with events and such. I'm really proud of this because I'm not a whole lot proficient at C++.
What it is, is an entity factory where the properties of the entities can be got/set and events can be hooked and called. The reason it uses std::strings is that ultimately the system will be used alongside a home-made scripting engine and/or a level editor for a game.
Unfortunately this means there's a whole bunch of std::maps and std::queues for each entity.
Here is a sample at what it can do
[cpp]
int main()
{
// Create two entities (entity class, unique name)
Entities::Base* light = Entities::create("Light", "light");
Entities::Base* button = Entities::create("ToggleButton", "button");
// Set properties
button->setProperty("x", 50);
button->setProperty("y", 25);
// Or access the members directly
light->x = 70;
light->y = 25;
// Turn the light on initially
light->setProperty("isOn", 1);
// Hook the button's onToggle event to toggle the light
button->hookEvent("onToggle", light, "toggle");
button->runFunction("toggle");
PRINT("Light is " << ( light->getProperty("isOn") ? "on" : "off" )); // Light is off
button->runFunction("toggle");
PRINT("Light is " << ( light->getProperty("isOn") ? "on" : "off" )); // Light is on
return 0;
}
[/cpp]
And here is the Light and ToggleButton definitions
[cpp]
class ToggleButton: public Base
{
private:
bool value;
public:
EntityEvent onToggle;
void toggle()
{
value = !value;
onToggle.emit();
}
ToggleButton()
{
registerFunction("toggle", this, &ToggleButton::toggle);
registerEvent("onToggle", &onToggle);
}
};
ENTITY_REGISTER("ToggleButton", ToggleButton);
class Light: public Base
{
private:
public:
int value;
void toggle() { value = !value; }
void turnOn() { value = 1; }
void turnOff() { value = 0; }
int getValue() { return value; }
Light()
{
registerProperty("isOn", &value);
registerFunction("toggle", this, &Light::toggle);
registerFunction("turnOn", this, &Light::turnOn);
registerFunction("turnOff", this, &Light::turnOff);
}
};
ENTITY_REGISTER("Light", Light);
[/cpp]
[QUOTE=Vampired;19866437][cpp]
ENTITY_REGISTER("Light", Light);
[/cpp][/QUOTE]
Just a heads up, you don't need Light twice there
This will do the same job (I believe)
[cpp]
#define ENTREG(x) ENTITY_REGISTER(#x, x)
[/cpp]
(edit: Fixed macro according to nullsquared's post)
[QUOTE=turby;19866550]Just a heads up, you don't need Light twice there
This will do the same job (I believe)
[cpp]
#define ENTREG(x) ENTITY_REGISTER("##x##", x)
[/cpp][/QUOTE]
ENTITY_REGISTER is already a macro that does a whole bunch of stuff but doing ("##classname##") always produced the litteral "##classname##" rather than what I expected.
[QUOTE=Vampired;19866700]ENTITY_REGISTER is already a macro that does a whole bunch of stuff but doing ("##classname##") always produced the litteral "##classname##" rather than what I expected.[/QUOTE]
#classname
## concats, # puts stuff in a string
[QUOTE=nullsquared;19866925]#classname
## concats, # puts stuff in a string[/QUOTE]
Ahh righty. Fixed
[media]http://www.youtube.com/watch?v=Z2qOAQ9WtMI[/media]
More progress! Woo!
Changelog:
- v2:
-- Health bar
-- 5 different boxes that you can spawn
-- Added animation for moving up and down
-- Fixed being able to glitch up the animations when holding A and D at the same time (left and right keys)
- v1:
-- First beta with working sprite drawing, movement, and boundaries.
Collisions is going to be a BITCH. Might do bounding box for starters.
[QUOTE=turby;19868440]Ahh righty. Fixed[/QUOTE]
Nono you have "#x", its just plain old #x. If x is int, then #x will be "int".
[editline]08:15PM[/editline]
[QUOTE=The Inzuki;19868777]
[i]stuff[/i]
[/quote]
Nice :smile:
[QUOTE=nullsquared;19865666]Yeah definitely, I need to look into some spacial optimization too, hm... :raise:
BTW, you inspired me to do some AO
[img]http://img341.imageshack.us/img341/6753/aoshot.png[/img][/QUOTE]
I believe same code, how many samples?
Think I'm gonna have to code my own font renderer. The D3D font renderer is way too slow for the amount of text I need to draw in botched.. need to make one that draws an atlas I think. Which you'd think the D3D one did - but I'm 90% sure it's using the GDI font rendering stuff.. :/
[QUOTE=s0ul0r;19870158]I believe same code, how many samples?[/QUOTE]
1024 uniform samples, no randomization. I need to add some randomization which would introduce some noise, but the samples can go down to like 128 or less.
[QUOTE=nullsquared;19870443]1024 uniform samples, no randomization. I need to add some randomization which would introduce some noise, but the samples can go down to like 128 or less.[/QUOTE]
Rendertime?
[QUOTE=s0ul0r;19870509]Rendertime?[/QUOTE]
I think it was about 30 seconds for that render, 2 threads.
Sorry, you need to Log In to post a reply to this thread.