MineCraft Distorterator [Not any more, Fixed it :D]

Posted By: the_mehmaster

MineCraft Distorterator [Not any more, Fixed it :D] - 12/22/10 05:39

If you want to be 'In the know' about what this topic used to be about, scroll down a bit. Otherwise, you can just read this grin

So I have optimised my 3dgs minecraft level editor (well, viewer for the moment grin)
a little bit (And I stress the 'little bit' a lot..)

I don't care! show me a picture!

Okay then smile



That's 256 chunks, runs at a measly 10fps
(Although that's still a lot better than 16 chunks at that speed)
Also, thanks to Damocles for the optimisation tips smile

Here's a close-up, in that same session:


It's cube-licious! grin

If anyone has more optimisation tips, I'm more than happy to listen. laugh

Also, if a mod could move this to the 'projects' forum that'd be nice smile
Originally Posted By: the_mehmaster
Yesterday I was thinking that it would be quite useful (and pretty
cool) to have a minecraft editor (like MCedit) but made in 3DGS.

I started coding this morning and all went well, I learnt a
couple of zlib functions (minecraft chunks are gzip-encoded)

Spent an hour importing and making '.mdl' versions of minecraft blocks

Then I successfully loaded a chunk, no errors. grin

So then I worked on the base-36 system, with file-directories and
such. I thought it would work fine.

I tested it on my savefile, and here's what I got grin:-


A big mess..

'I should be able to fix it pretty easily', I thought.

But then I zoomed out a bit more:-


An utter and complete mess.

It was at that point that I gave up on the project, closed the files, and renamed the main-script 'mineCraftDistorterator.c'.

Just thought you might be interested grin

EDIT: I'm using A8 free because I havn't bothered to upgrade yet cool

Also, in the highly unlikely event that anyone wants the source, ask here and I'll upload it. smile

Posted By: msmith2468

Re: MineCraft Distorterator ;) - 12/22/10 06:25

thats cool i like it.
i would be intrested in looking at it if you dont mind.
just for fun. i might learn something new.

thanks for shareing laugh
Posted By: the_mehmaster

Re: MineCraft Distorterator ;) - 12/22/10 07:57

Actually, turns out I got it to work properly smile

But I'm having EXTREME fps (runs at ~10 fps with 16 chunks loaded) issues.. I'll have a go at optimising it tomorrow.

Whether I make any progress or not, I'll upload the source sometime soon. (within 48h)
Posted By: Damocles_

Re: MineCraft Distorterator ;) - 12/22/10 10:18

Try writing a function, wich makes blocks invisible, that
have another (full, non transparent) block on each of its
6 sides.
This should tremendously reduce the number of blocks to draw.

When I hink about it:
Notch could have written a block-storage format, wich would
be only a few kilobytes, instead of several megabytes.

Simply by only saving blocks that have changed.
As the world is initially generated using a random seed,
the world-shape could be recreated from a single integer number.
And only parts that have changed (added/removed) would need to be saved.
Posted By: the_mehmaster

Re: MineCraft Distorterator ;) - 12/22/10 11:00

Quote:
Try writing a function, wich makes blocks invisible, that
have another (full, non transparent) block on each of its
6 sides.
This should tremendously reduce the number of blocks to draw.

Ah, good idea. That's along the lines of what I was thinking of... smile

Quote:
When I think about it:
Notch could have written a block-storage format, wich would
be only a few kilobytes, instead of several megabytes.

Simply by only saving blocks that have changed.
As the world is initially generated using a random seed,
the world-shape could be recreated from a single integer number.
And only parts that have changed (added/removed) would need to be saved.


That will be true for smaller filesize, but I think that speed of access (especially in large amounts, and in multiplayer servers)
would suffer considerably from such a format simply because the overhead is moved from the RAM or hard-disk to the CPU. Good concept, though.
Posted By: Damocles_

Re: MineCraft Distorterator ;) - 12/22/10 11:25

On the other hand, calculating the position of blocks is definately
faster than transporting the blockpositions
over the net.

So the time to load the level might be smaller.

And these weired errors (mountains cut on a straigt line)
on servers would be gone.


He then just needs to keep the old generation-algorythm
in the code, in case he changes them, so servers/clients can
recreate the fromer look of the terrain after an update.
Posted By: the_mehmaster

Re: MineCraft Distorterator ;) - 12/23/10 01:46

I took your optimisation onboard, it works tonnes better smile

Also, I updated the first post because it's not really
'minecraft distorterator' any more grin
Posted By: the_mehmaster

Re: MineCraft Distorterator ;) - 12/23/10 02:20

I did a crazy stress-test grin

1024 chunks, 3 FPS :


Why the heck did I do this?!

You gotta admit, It does look pretty cool grin
Posted By: Joozey

Re: MineCraft Distorterator ;) - 12/23/10 02:28

Nice work grin.
Are your models one whole block? Are sides also visible that are actually facing away from the camera, or between other blocks?
Posted By: the_mehmaster

Re: MineCraft Distorterator ;) - 12/23/10 02:47

Quote:
Are your models one whole block? Are sides also visible that are actually facing away from the camera, or between other blocks?
Yeah they are.. That's probably the main performance problem at the moment.

I'll have a go at fixing it up smile.
Posted By: FBL

Re: MineCraft Distorterator ;) - 12/23/10 09:30

Interesting. I get performance problems with a lot less (and partly even simpler) models with a different project.
Guess I need to find out what I'm doing wrong...
Posted By: Damocles_

Re: MineCraft Distorterator ;) - 12/23/10 16:59

would be cool if you can make an editor out of that,
and export it in the correct format.

Then people can create custom levels in the editor.
(like for an arena / adventure or such)
Posted By: Superku

Re: MineCraft Distorterator ;) - 12/23/10 18:24

Quote:
If anyone has more optimisation tips, I'm more than happy to listen.

set(ENTITY,UNLIT | NOFILTER);
ENTITY.emask &= ~DYNAMIC;
When your block-models have more than 1 skin, f.i. the grass-dirt-block, they render way slower than models with only 1 skin. Combine both textures, grass and dirt, into one (bigger) texture, this will increase your fps remarkably.
Posted By: the_mehmaster

Re: MineCraft Distorterator ;) - 12/23/10 21:10

@Firoball:
Quote:
Guess I need to find out what I'm doing wrong...

It might simply be our computers serving as difference, as I am not optimising that much a the moment.
My computer's not exactly 'high-end', But it's still pretty modern
(core i5, HD 5770s)
What type of system are you running?

@Damocles_:
Quote:
would be cool if you can make an editor out of that,
and export it in the correct format.

Then people can create custom levels in the editor.
(like for an arena / adventure or such)

Yeah that's what I was originally planning on, but to get to that stage
the performance problems need to be fixed completely grin.

@Superku:
Quote:
set(ENTITY,UNLIT | NOFILTER);
ENTITY.emask &= ~DYNAMIC;
When your block-models have more than 1 skin, f.i. the grass-dirt-block, they render way slower than models with only 1 skin. Combine both textures, grass and dirt, into one (bigger) texture, this will increase your fps remarkably.


Okay thanks for those flags, I'll be using them smile.
All the models only use one texture already grin
But the linear-interpolation on them makes them look horrible,
wish there was a way to disable it.. I tried setting d3d_mipmapping to point.


EDIT: God I think I need to grow a brain sometime Haha grin
You just told me how to fix that!
Posted By: Superku

Re: MineCraft Distorterator ;) - 12/23/10 21:19

Quote:
But the linear-interpolation on them makes them look horrible,
wish there was a way to disable it.. I tried setting d3d_mipmapping to point.

That's what's NOFILTER is for.

BTW nice project (if you make it an editor).
Posted By: the_mehmaster

Re: MineCraft Distorterator ;) - 12/23/10 21:45

Quote:
That's what's NOFILTER is for.

I just figured that right before I saw your post grin Haha...

Thanks anyways smile
Posted By: Damocles_

Re: MineCraft Distorterator ;) - 12/23/10 21:53

Dont just make blocks invisible, better is to remove them / add them.
I guess that invisible blocks still drain CPU power,
especially in these large amounts.

For the normal landscape overview cou could remove any block wich
has either no sky above it, or not a side to an
area the has a sky above it.
© 2024 lite-C Forums