I'm running in release. Debug mode is much much slower though.
[cpp]
void EntityManager::Tick()
{
double NewTime = double(CurTime.GetElapsedTime()) / 1000;
if (DrawSortRequired)
{
Entities.sort(EntityManager::CompareDrawOrder);
DrawSortRequired = false;
}
//Remove this eventually
if (InputHandler::IsKeyPressed(sf::Keyboard::Space))
{
CreateEntity("ent_test", pRender);
CreateEntity("ent_test", pRender);
}
GameGlobals::Instance()->CurTime = NewTime;
std::list<BaseEntity*>::iterator i;
if (LastThink + Delta < NewTime)
{
i = Entities.begin();
while (i != Entities.end())
{
BaseEntity *ent = *i;
if (ent->DeleteMe == true)
{
i = Entities.erase(i);
delete ent;
}
else
{
ent->Think();
i++;
}
}
double frameTime = NewTime - CurrentTime;
CurrentTime = NewTime;
GameGlobals::Instance()->FrameTime = frameTime;
LastThink = NewTime;
}
i = Entities.begin();
while (i != Entities.end())
{
BaseEntity *ent = *i;
ent->Draw();
pRender->Draw(EntityCount);
i++;
}
}
[/cpp]
Heres my main game loop, if you see anything obviously slow :)
Floating blocks of doom!
[thumb]http://img688.imageshack.us/img688/3986/minecraftclone201108112.png[/thumb]
[QUOTE=s0ul0r;31673724]Floating blocks of doom!
[thumb]http://img688.imageshack.us/img688/3986/minecraftclone201108112.png[/thumb][/QUOTE]
That texture pack...
Dokucraft light :>
[QUOTE=WeltEnSTurm;31673371]Is there some app to make screenshots like this, or do you stick the fragments together yourself?
Or, did you just Ctrl+Mousewheel? :v:[/QUOTE]
I couldn't zoom out far enough, so I photoshopped it together. There are probably apps for it though.
[QUOTE=s0ul0r;31673826]Dokucraft light :>[/QUOTE]
It begins...
I'll just leave this here, before anyone else does.
[url]http://pastebin.com/Fu5Rqztr[/url]
[QUOTE=thf;31664929]What networking API are you using for that? Looks fun to make, I'd make one myself :v:[/QUOTE]WinSock2
Major milestone. I've rewritten everything, and with my newfound knowledge of the stack, esp and ebp, managed to compile this piece of code:
[cpp]
int x;
int t(int c)
{
int b()
{
x = c;
}
b();
}
t(25);
[/cpp]
Into completely stand-alone assembly.
Also, I named the language "Charles".
I think I'm doing my perlin noise wrong. I'm attempting to get 1D terrain so I'm using
[cpp]
float PerlinNoise::GetNoise1D(float x)
{
int floorx = ((int)x);
float fractx = x - floorx;
float s,t;
s = Noise1D(floorx);
t = Noise1D(floorx + 1);
return Interpolate(s, t, fractx);
}
[/cpp]
to get 1D terrain via
[cpp]
for(int i = 0; i < 800; i++)
{
int y = (int)((perlin.GetNoise1D(i) * 300) + 300);
std::cout << perlin.GetNoise1D(i) << std::endl;
SetPixel(i, y, true);
}
[/cpp]
However, this just gives me a bunch of dots all over the place, when I want something like this:
[img]http://freespace.virgin.net/hugo.elias/models/m_inter2.gif[/img]
[QUOTE=Overv;31673889]I couldn't zoom out far enough, so I photoshopped it together. There are probably apps for it though.[/QUOTE]
Why does your avatar have dicks for fingers, Overv?
[editline]11th August 2011[/editline]
It's like a vault boy meatspin.
[editline]11th August 2011[/editline]
And ohgod what is his elbow doing, near the end it slides like jelly.
[QUOTE=conman420;31673621]I'm running in release. Debug mode is much much slower though.
Heres my main game loop, if you see anything obviously slow :)[/QUOTE]
I would avoid sorting by draw order every frame. Just sort whenever a new entity is created.
(If you want to optimize it even more, have something like an hashtable<int, vector<entity>>, and then draw in the order of the hashtable keys. Insert entities in the hashtable only on creation.)
I'm not used to c++ so I don't see any possible error. Have you tried profiling / commenting certain parts of the code to see what the bottleneck is?
[QUOTE=DeadKiller987;31674121]I'll just leave this here, before anyone else does.
[url]http://pastebin.com/Fu5Rqztr[/url][/QUOTE]
So much drama.
2:02 PM - {R}MMavipc: give me summary of what happened
2:02 PM - {R}MMavipc does not want to read wall of txt
2:03 PM - BackwardSpy: @MMavipc: BackwardSpy: HI I'M DEVBUG, I DON'T NEED FRIENDS I JUST NEED MONEY COS THEN I CAN BUY FRIENDS
2:03 PM - BackwardSpy: that sums it up I think
2:03 PM - Dlaor: ^
2:03 PM - Blk: ^
[QUOTE=Dr Magnusson;31674184]Also, I named the language "Charles".[/QUOTE]
GODDAMN YOU
didn't we clear it up that [B][I]I[/I][/B] was gonna make charles :(
[QUOTE=mmavipc;31675465][URL="steam://friends/joinchat/103582791430091926"]Click here[/URL][/QUOTE]Why hadn't I already joined that group?
[QUOTE]6:57 PM - Jawalt: Isn't bandwagons sort of a bandwagon in itself
6:57 PM - Jawalt: A bandwagon about bandwagonning
6:57 PM - devbug: BANDWAGONS!BANDWAGONS!BANDWAGONS!
6:57 PM - Jawalt: OH GOD THE UNIVERSE
6:57 PM - BackwardSpy: bandwagception
6:57 PM - devbug: lol
6:57 PM - devbug: That made my day
6:57 PM - devbug: We need to go deeper
[/QUOTE]
Sorry just had to put this out there...
Can we not bring all the FP programmers chat drama into this thread? its bad enought in the chat
[QUOTE=DeadKiller987;31674121]I'll just leave this here, before anyone else does.
[URL]http://pastebin.com/Fu5Rqztr[/URL][/QUOTE]
Wow, does it even matter that much?
I started off trying to get SFML working with CodeBlocks, and ended up making a pretty useless console application which uses its random functions.
[IMG]http://i55.tinypic.com/3523b14.png[/IMG]
If I had typed in "B" or "Basic" at the beginning (or any different capitalization, or just hit enter), it would have asked me for what die to roll and how many times.
[QUOTE=DeadKiller987;31674121]I'll just leave this here, before anyone else does.
[url]http://pastebin.com/Fu5Rqztr[/url][/QUOTE]
"sand nigger" .... really?
I've got into linux and i'm really happy with how code::blocks works on it.
I even started on a voxel engine that will hopefully allow for a huge amount of editable voxels on screen.
[img]http://www.1337upload.net/files/20110811-181724-0.png[/img]
All i have to show is a 32x32x32 cube rendered with GL_POINTS though. v:v:v
[QUOTE=Naelstrom;31679088]I even started on a voxel engine that will hopefully allow for a huge amount of editable voxels on screen.[/QUOTE]
Somehow I read this as 'edible' and had a vision of a minecraft-like character chewing through entire landscapes
[QUOTE=NovembrDobby;31679461]Somehow I read this as 'edible' and had a vision of a minecraft-like character chewing through entire landscapes[/QUOTE]
Is there a voxel pacman game?
Because there totally should be.
[QUOTE=Overv;31672346]Almost done now!
[img]http://images.overvprojects.nl/SS-2011-08-11_20.38.16.png[/img][/QUOTE]
Contextual comments would be cool. Like [url=http://www.djangobook.com/about/comments/]this[/url].
[QUOTE=Ortzinator;31680090]Contextual comments would be cool. Like [url=http://www.djangobook.com/about/comments/]this[/url].[/QUOTE]
I agree, I'll try to implement that functionality tomorrow. Chapter 2 is now [url=http://open.gl/?page=context]available[/url]. I'll read through it tomorrow and correct any mistakes I find and any pointed out by you.
[QUOTE=Overv;31680352]I agree, I'll try to implement that functionality tomorrow. Chapter 2 is now [url=http://open.gl/?page=context]available[/url]. I'll read through it tomorrow and correct any mistakes I find and any pointed out by you.[/QUOTE]
Looks like a great chapter. I scanned it over and don't you have to put #define UNICODE before including the window.h so that it takes wide characters?
[QUOTE=awfa3;31680655]Looks like a great chapter. I scanned it over and don't you have to put #define UNICODE before including the window.h so that it takes wide characters?[/QUOTE]
No, the character set is unicode by default.
[QUOTE=Overv;31680352]I agree, I'll try to implement that functionality tomorrow. Chapter 2 is now [url=http://open.gl/?page=context]available[/url]. I'll read through it tomorrow and correct any mistakes I find and any pointed out by you.[/QUOTE]
Great read! To bad I can't compile. You will be writing the guide for Linux too right? :>
Sorry, you need to Log In to post a reply to this thread.