How to pick blocks in minecraft?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
SGH
Posts: 13
Joined: Wed Aug 24, 2011 2:53 pm

Re: How to pick blocks in minecraft?

Post by SGH »

Well, check out the Q3 tutorials, and do so: Point a ray in a straight direction, check if it collides, and get the node it is colliding with. Make a new cube, scale it a bit (1.0001 maybe) and enable Wireframe.
Radikalizm
Posts: 1215
Joined: Tue Jan 09, 2007 7:03 pm
Location: Leuven, Belgium

Re: How to pick blocks in minecraft?

Post by Radikalizm »

SGH wrote:Well, check out the Q3 tutorials, and do so: Point a ray in a straight direction, check if it collides, and get the node it is colliding with. Make a new cube, scale it a bit (1.0001 maybe) and enable Wireframe.
Creating that many cubes at runtime = not a good idea ;)
Cube_
Posts: 1010
Joined: Mon Oct 24, 2011 10:03 pm
Location: 0x45 61 72 74 68 2c 20 69 6e 20 74 68 65 20 73 6f 6c 20 73 79 73 74 65 6d

Re: How to pick blocks in minecraft?

Post by Cube_ »

804 wrote:do you think this would be a nice and fast way to render the minecraft like terrain
http://irrlicht.sourceforge.net/forum/v ... =6&t=39598

but when i compile the example....

Code: Select all

1>------ Erstellen gestartet: Projekt: irlicht test, Konfiguration: Debug Win32 ------
1>  main.cpp
1>c:\users\voss\documents\programierung\gameprojects\irlicht test\irlicht test\cmeshcombiner.h(62): warning C4520: 'CMeshCombiner': Mehrere Standardkonstruktoren angegeben
1>c:\users\voss\documents\programierung\gameprojects\irlicht test\irlicht test\main.cpp(98): warning C4244: 'Argument': Konvertierung von 'time_t' in 'unsigned int', möglicher Datenverlust
1>c:\users\voss\documents\programierung\gameprojects\irlicht test\irlicht test\main.cpp(127): error C2661: 'CMeshCombiner::CMeshCombiner': Keine überladene Funktion akzeptiert 3 Argumente
1>c:\users\voss\documents\programierung\gameprojects\irlicht test\irlicht test\main.cpp(128): error C2660: 'CMeshCombiner::combineMeshes': Funktion akzeptiert keine 2 Argumente
1>  CMeshCombiner.cpp
1>c:\users\voss\documents\programierung\gameprojects\irlicht test\irlicht test\cmeshcombiner.h(62): warning C4520: 'CMeshCombiner': Mehrere Standardkonstruktoren angegeben
1>c:\users\voss\documents\programierung\gameprojects\irlicht test\irlicht test\cmeshcombiner.cpp(9): warning C4018: '<': Konflikt zwischen 'signed' und 'unsigned'
1>c:\users\voss\documents\programierung\gameprojects\irlicht test\irlicht test\cmeshcombiner.cpp(18): warning C4018: '<': Konflikt zwischen 'signed' und 'unsigned'
1>c:\users\voss\documents\programierung\gameprojects\irlicht test\irlicht test\cmeshcombiner.cpp(32): warning C4018: '<': Konflikt zwischen 'signed' und 'unsigned'
1>c:\users\voss\documents\programierung\gameprojects\irlicht test\irlicht test\cmeshcombiner.cpp(54): warning C4018: '<': Konflikt zwischen 'signed' und 'unsigned'
1>c:\users\voss\documents\programierung\gameprojects\irlicht test\irlicht test\cmeshcombiner.cpp(96): warning C4018: '>': Konflikt zwischen 'signed' und 'unsigned'
1>c:\users\voss\documents\programierung\gameprojects\irlicht test\irlicht test\cmeshcombiner.cpp(99): warning C4018: '>': Konflikt zwischen 'signed' und 'unsigned'
1>c:\users\voss\documents\programierung\gameprojects\irlicht test\irlicht test\cmeshcombiner.cpp(165): warning C4018: '<': Konflikt zwischen 'signed' und 'unsigned'
1>c:\users\voss\documents\programierung\gameprojects\irlicht test\irlicht test\cmeshcombiner.cpp(170): warning C4018: '<': Konflikt zwischen 'signed' und 'unsigned'
1>c:\users\voss\documents\programierung\gameprojects\irlicht test\irlicht test\cmeshcombiner.cpp(186): warning C4018: '<': Konflikt zwischen 'signed' und 'unsigned'
1>c:\users\voss\documents\programierung\gameprojects\irlicht test\irlicht test\cmeshcombiner.cpp(189): warning C4244: 'Argument': Konvertierung von 'irr::u32' in 'float', möglicher Datenverlust
1>c:\users\voss\documents\programierung\gameprojects\irlicht test\irlicht test\cmeshcombiner.cpp(189): warning C4244: 'Initialisierung': Konvertierung von 'float' in 'irr::u32', möglicher Datenverlust
1>c:\users\voss\documents\programierung\gameprojects\irlicht test\irlicht test\cmeshcombiner.cpp(190): warning C4244: 'Argument': Konvertierung von 'irr::u32' in 'float', möglicher Datenverlust
1>c:\users\voss\documents\programierung\gameprojects\irlicht test\irlicht test\cmeshcombiner.cpp(190): warning C4244: 'Initialisierung': Konvertierung von 'float' in 'irr::u32', möglicher Datenverlust
1>c:\users\voss\documents\programierung\gameprojects\irlicht test\irlicht test\cmeshcombiner.cpp(201): warning C4018: '<': Konflikt zwischen 'signed' und 'unsigned'
1>c:\users\voss\documents\programierung\gameprojects\irlicht test\irlicht test\cmeshcombiner.cpp(205): warning C4244: 'Initialisierung': Konvertierung von 'float' in 'int', möglicher Datenverlust
1>c:\users\voss\documents\programierung\gameprojects\irlicht test\irlicht test\cmeshcombiner.cpp(206): warning C4244: 'Initialisierung': Konvertierung von 'float' in 'int', möglicher Datenverlust
1>c:\users\voss\documents\programierung\gameprojects\irlicht test\irlicht test\cmeshcombiner.cpp(211): warning C4018: '<': Konflikt zwischen 'signed' und 'unsigned'
1>c:\users\voss\documents\programierung\gameprojects\irlicht test\irlicht test\cmeshcombiner.cpp(219): warning C4018: '<': Konflikt zwischen 'signed' und 'unsigned'
1>c:\users\voss\documents\programierung\gameprojects\irlicht test\irlicht test\cmeshcombiner.cpp(227): warning C4018: '<': Konflikt zwischen 'signed' und 'unsigned'
1>c:\users\voss\documents\programierung\gameprojects\irlicht test\irlicht test\cmeshcombiner.cpp(231): warning C4018: '<': Konflikt zwischen 'signed' und 'unsigned'
1>c:\users\voss\documents\programierung\gameprojects\irlicht test\irlicht test\cmeshcombiner.cpp(283): warning C4244: 'Initialisierung': Konvertierung von 'double' in 'int', möglicher Datenverlust
1>c:\users\voss\documents\programierung\gameprojects\irlicht test\irlicht test\cmeshcombiner.cpp(360): warning C4018: '<': Konflikt zwischen 'signed' und 'unsigned'
1>c:\users\voss\documents\programierung\gameprojects\irlicht test\irlicht test\cmeshcombiner.cpp(387): warning C4018: '<': Konflikt zwischen 'signed' und 'unsigned'
1>c:\users\voss\documents\programierung\gameprojects\irlicht test\irlicht test\cmeshcombiner.cpp(389): warning C4018: '<': Konflikt zwischen 'signed' und 'unsigned'
1>c:\users\voss\documents\programierung\gameprojects\irlicht test\irlicht test\cmeshcombiner.cpp(402): warning C4018: '<': Konflikt zwischen 'signed' und 'unsigned'
1>c:\users\voss\documents\programierung\gameprojects\irlicht test\irlicht test\cmeshcombiner.cpp(427): warning C4018: '<': Konflikt zwischen 'signed' und 'unsigned'
1>c:\users\voss\documents\programierung\gameprojects\irlicht test\irlicht test\cmeshcombiner.cpp(428): warning C4018: '<': Konflikt zwischen 'signed' und 'unsigned'
1>c:\users\voss\documents\programierung\gameprojects\irlicht test\irlicht test\cmeshcombiner.cpp(431): warning C4018: '<': Konflikt zwischen 'signed' und 'unsigned'
1>c:\users\voss\documents\programierung\gameprojects\irlicht test\irlicht test\cmeshcombiner.cpp(446): warning C4018: '<': Konflikt zwischen 'signed' und 'unsigned'
1>c:\users\voss\documents\programierung\gameprojects\irlicht test\irlicht test\cmeshcombiner.cpp(469): warning C4018: '<': Konflikt zwischen 'signed' und 'unsigned'
1>c:\users\voss\documents\programierung\gameprojects\irlicht test\irlicht test\cmeshcombiner.cpp(487): warning C4018: '<': Konflikt zwischen 'signed' und 'unsigned'
1>  Code wird generiert...
========== Erstellen: 0 erfolgreich, Fehler bei 1, 0 aktuell, 0 übersprungen ==========
 

No... use PolyVox.
"this is not the bottleneck you are looking for"
mongoose7
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Re: How to pick blocks in minecraft?

Post by mongoose7 »

Maybe don't use -Wall? You may be doing a 64-bit compile, in which case it would not be a good idea to put a time_t into an int, but problems won't start to show up until 2038 so I guess it really doesn't matter.
804
Posts: 73
Joined: Thu Nov 10, 2011 7:07 pm

Re: How to pick blocks in minecraft?

Post by 804 »

Why, what are the advantages?
///////////////////////////////////////////
My Forum: http://game-home.1x.de/
My Homepage: http://mediadesign.about.lc/
///////////////////////////////////////////
mongoose7
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Re: How to pick blocks in minecraft?

Post by mongoose7 »

It is difficult to avoid: Konflikt zwischen 'signed' und 'unsigned'. I'm not sure, but

Code: Select all

unsigned int i;
if (i > 7) {}
may produce a warning because, as I understand it, "7" is an integer. Well, maybe it is a double.

Though, since you asked the question, I really would look into complaints that the number of arguments do not match the function prototype. I had ignored them because I thought one of the arguments was subject to an error report, but you don't have errors, you only have warnings.

Anyway, it is better for your code to compile cleanly than to produce warnings, because, if you start ignoring warnings, you may miss a really important one. A warning doesn't mean everything is OK, it just means the compiler was able to generate code. What that code does, though, is anybody's business.

Or have I misunderstood?
804
Posts: 73
Joined: Thu Nov 10, 2011 7:07 pm

Re: How to pick blocks in minecraft?

Post by 804 »

No... use PolyVox.
but why? And how to include PolyVox to Irrlicht?
Are there any tutorials for PolyVox and Irrlicht?

PS: I will set the language of my compiler from german to english ;)
///////////////////////////////////////////
My Forum: http://game-home.1x.de/
My Homepage: http://mediadesign.about.lc/
///////////////////////////////////////////
Virror
Posts: 191
Joined: Mon May 02, 2011 3:15 pm

Re: How to pick blocks in minecraft?

Post by Virror »

PolyVox is practically made for this kind of use. Just check the tutorial they have on the website.
Then search the forum for Irrlicht integration, very easy.
For block picking, just calculate voxel position from the ray hit coordinates and remove that voxel when you want to remove a block.
804
Posts: 73
Joined: Thu Nov 10, 2011 7:07 pm

Re: How to pick blocks in minecraft?

Post by 804 »

OK, and why is it as fast?
///////////////////////////////////////////
My Forum: http://game-home.1x.de/
My Homepage: http://mediadesign.about.lc/
///////////////////////////////////////////
Virror
Posts: 191
Joined: Mon May 02, 2011 3:15 pm

Re: How to pick blocks in minecraft?

Post by Virror »

Who said anything about faster? After all, its up to you to do the implementation. Its not easy to make a good minecraft clone as many here already stated.
804
Posts: 73
Joined: Thu Nov 10, 2011 7:07 pm

Re: How to pick blocks in minecraft?

Post by 804 »

I know that its very difficult to make a game like this, but i am very motivated to get the knowledge and start my project.

I mean, why is it faster to use polyvox to render so many cubes?
And why should i use polivox instead of the mesh combiner (viewtopic.php?f=6&t=39598) ?
///////////////////////////////////////////
My Forum: http://game-home.1x.de/
My Homepage: http://mediadesign.about.lc/
///////////////////////////////////////////
Cube_
Posts: 1010
Joined: Mon Oct 24, 2011 10:03 pm
Location: 0x45 61 72 74 68 2c 20 69 6e 20 74 68 65 20 73 6f 6c 20 73 79 73 74 65 6d

Re: How to pick blocks in minecraft?

Post by Cube_ »

all documentation on polyvox:
http://www.volumesoffun.com/wordpress/?page_id=43

also you will find the download on the very same website ^^
"this is not the bottleneck you are looking for"
mongoose7
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Re: How to pick blocks in minecraft?

Post by mongoose7 »

MeshCombiner cannot be used for a MineCraft clone because the mesh becomes too large to render in less than a second. If you want good frame rates you need to find another way.
Virror
Posts: 191
Joined: Mon May 02, 2011 3:15 pm

Re: How to pick blocks in minecraft?

Post by Virror »

As i said, no one have stated PolyVox is faster than using mesh combiner. But the good thing about PolyVox is thats its very easy to make minecraft like terrain with it since it has built in support to make "blocky worlds".
Very simple to just take a heightmap and make a blocky terrain from it. It also have good support for making very huge volumes with callback functions for paging and stuff.
804
Posts: 73
Joined: Thu Nov 10, 2011 7:07 pm

Re: How to pick blocks in minecraft?

Post by 804 »

Is there an Example of Blocky terrains? I don't Know where to start...
///////////////////////////////////////////
My Forum: http://game-home.1x.de/
My Homepage: http://mediadesign.about.lc/
///////////////////////////////////////////
Post Reply