How to pick blocks in minecraft?
Re: How to pick blocks in minecraft?
Check irr::core::aabbox3df - that's a class for an axis aligned bounding box (axis aligned meaning that it's not rotated - if you want it rotated you can use a aabbox3df + some rotation matrix).
One way is you check a line going from your camera into the screen (Irrlicht has functions for that - check the collision tutorial) against every single box in your world. I didn't think yet about optimizing collisions for a minecraft-clone and there are very likely a lot faster ways, but for a start with a small world this would do.
To check line vs boundingbox collisions the first test is if they collide at all - you can do that with aabbox3df::intersectsWithLine. Then you could do test against all box-sides (using planes) - but it's not necessary in this case probably. As boxes all have the same size it probably works just find all boxes which collide against the wall and then find the one of the colliding ones where the box-center is nearest to your camera.
Don't know about drawing those nice lines - for a start just use the line-drawing functions of the Irrlicht driver (for the corners of your bounding-box).
One way is you check a line going from your camera into the screen (Irrlicht has functions for that - check the collision tutorial) against every single box in your world. I didn't think yet about optimizing collisions for a minecraft-clone and there are very likely a lot faster ways, but for a start with a small world this would do.
To check line vs boundingbox collisions the first test is if they collide at all - you can do that with aabbox3df::intersectsWithLine. Then you could do test against all box-sides (using planes) - but it's not necessary in this case probably. As boxes all have the same size it probably works just find all boxes which collide against the wall and then find the one of the colliding ones where the box-center is nearest to your camera.
Don't know about drawing those nice lines - for a start just use the line-drawing functions of the Irrlicht driver (for the corners of your bounding-box).
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: How to pick blocks in minecraft?
thanks
///////////////////////////////////////////
My Forum: http://game-home.1x.de/
My Homepage: http://mediadesign.about.lc/
///////////////////////////////////////////
My Forum: http://game-home.1x.de/
My Homepage: http://mediadesign.about.lc/
///////////////////////////////////////////
-
- 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?
well... bounding boxes, already mentioned, do some searching
Anyway, here's an idea:
Make a game, let's say a card game! (shouldn't be to hard, yet more of a challenge than pong)
Let's choose an existing type, I will give 2 examples...
1. Texas hold 'em
2. Yu-Gi-Oh
your choise....
then make the game function according to the ruleset..
figure out a way for multiplayer (lots of available libraries with documentation, knock yourself out) <-optional, otherwise make AI
If you actually succeed, +10 internets to you
NOTE:
This is just an idea if you want a greater challenge than pong.
want more of a challenge?
example (using yu-gi-oh for this example)
Add cutscene events (for when you win, the duel starts, when monsters attack and so on)
3D models (like season1 yugi vs kaiba, when there are 3D projections of the monsters) <--- BONUS if they animate all the time
whatever else you can think of
Now, as mentioned this would prove to be quite a challenge(still easy compared to minecraft), but, please do try (after you've made pong!)
since this should give you an idea of making a 3D game (since it would kinda be 3D)
anyway, just an idea
Anyway, here's an idea:
Make a game, let's say a card game! (shouldn't be to hard, yet more of a challenge than pong)
Let's choose an existing type, I will give 2 examples...
1. Texas hold 'em
2. Yu-Gi-Oh
your choise....
then make the game function according to the ruleset..
figure out a way for multiplayer (lots of available libraries with documentation, knock yourself out) <-optional, otherwise make AI
If you actually succeed, +10 internets to you
NOTE:
This is just an idea if you want a greater challenge than pong.
want more of a challenge?
example (using yu-gi-oh for this example)
Add cutscene events (for when you win, the duel starts, when monsters attack and so on)
3D models (like season1 yugi vs kaiba, when there are 3D projections of the monsters) <--- BONUS if they animate all the time
whatever else you can think of
Now, as mentioned this would prove to be quite a challenge(still easy compared to minecraft), but, please do try (after you've made pong!)
since this should give you an idea of making a 3D game (since it would kinda be 3D)
anyway, just an idea
"this is not the bottleneck you are looking for"
Re: How to pick blocks in minecraft?
OK, thank you!
I will make a game like what you said, but i hate Yu-Gi-Oh... (I will make something else)
I will make a game like what you said, but i hate Yu-Gi-Oh... (I will make something else)
///////////////////////////////////////////
My Forum: http://game-home.1x.de/
My Homepage: http://mediadesign.about.lc/
///////////////////////////////////////////
My Forum: http://game-home.1x.de/
My Homepage: http://mediadesign.about.lc/
///////////////////////////////////////////
-
- 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?
Texas hold 'em perhaps? (poker)
"this is not the bottleneck you are looking for"
-
- Posts: 1215
- Joined: Tue Jan 09, 2007 7:03 pm
- Location: Leuven, Belgium
Re: How to pick blocks in minecraft?
Implementing the rules of a card game is ok to start with, as is representing the card game visually
The thing that to me sounds way too difficult for a beginner is the opponent AI, especially when it comes to poker
If you want a game which poses you a real challenge when playing card games you'll need your AI to be able to have a decent strategy to begin with, and it has to be able to adapt to the player's and the other NPCs' actions, which can be really difficult to get right
If you want something with AI in it I'd suggest pacman, since the ghosts pose a really interesting yet not too difficult challenge when it comes to AI, and it provides a great way to get started
The thing that to me sounds way too difficult for a beginner is the opponent AI, especially when it comes to poker
If you want a game which poses you a real challenge when playing card games you'll need your AI to be able to have a decent strategy to begin with, and it has to be able to adapt to the player's and the other NPCs' actions, which can be really difficult to get right
If you want something with AI in it I'd suggest pacman, since the ghosts pose a really interesting yet not too difficult challenge when it comes to AI, and it provides a great way to get started
-
- 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?
that's why a multiplayer library like RakNet would be a good aproach (Multiplayer instead of AI, and it is free for indie game-dev's!)
and those ghosts are bi*ches!
They always get me sooner or later
and those ghosts are bi*ches!
They always get me sooner or later
"this is not the bottleneck you are looking for"
Re: How to pick blocks in minecraft?
Yeah, i would like to make a online-Game, cos i hate to programm a difficult AI.
I won't make pacman (i like 2D-Games, but mInecraft is a 3D-game)
I won't make pacman (i like 2D-Games, but mInecraft is a 3D-game)
///////////////////////////////////////////
My Forum: http://game-home.1x.de/
My Homepage: http://mediadesign.about.lc/
///////////////////////////////////////////
My Forum: http://game-home.1x.de/
My Homepage: http://mediadesign.about.lc/
///////////////////////////////////////////
-
- 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?
Multiplayer Texas hold 'em (or other card game )
let's say.... 6 ppl(or any other number that you like), that would be a good start
let's say.... 6 ppl(or any other number that you like), that would be a good start
"this is not the bottleneck you are looking for"
-
- Posts: 1215
- Joined: Tue Jan 09, 2007 7:03 pm
- Location: Leuven, Belgium
Re: How to pick blocks in minecraft?
And good network programming is easy?804 wrote:Yeah, i would like to make a online-Game, cos i hate to programm a difficult AI.
I won't make pacman (i like 2D-Games, but mInecraft is a 3D-game)
Re: How to pick blocks in minecraft?
No, but easyer than a good AI.
(and Lots of fun)
(and Lots of fun)
///////////////////////////////////////////
My Forum: http://game-home.1x.de/
My Homepage: http://mediadesign.about.lc/
///////////////////////////////////////////
My Forum: http://game-home.1x.de/
My Homepage: http://mediadesign.about.lc/
///////////////////////////////////////////
-
- 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?
^^*
On that matter.....
Have to make multiplayer....
and a server client...
On that matter.....
Have to make multiplayer....
and a server client...
"this is not the bottleneck you are looking for"
Re: How to pick blocks in minecraft?
what kind of server do i need for the client? (are there any free servers to load up my client?)
///////////////////////////////////////////
My Forum: http://game-home.1x.de/
My Homepage: http://mediadesign.about.lc/
///////////////////////////////////////////
My Forum: http://game-home.1x.de/
My Homepage: http://mediadesign.about.lc/
///////////////////////////////////////////
-
- 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?
you could just let the users host it, I mean it shouldn't take that much bandwidth to host something like this.
"this is not the bottleneck you are looking for"
Re: How to pick blocks in minecraft?
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....
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 ==========
///////////////////////////////////////////
My Forum: http://game-home.1x.de/
My Homepage: http://mediadesign.about.lc/
///////////////////////////////////////////
My Forum: http://game-home.1x.de/
My Homepage: http://mediadesign.about.lc/
///////////////////////////////////////////