2015-03-20 22:11:49

Hello!
;Interested in questions such as:
1. how to make 3d games on bgt? ;that is, I have a 3d map on which objects are placed. ;how do I play them in 3d? ;let's say I do shooter, I'll voice enemies? ;heard that you need ispolzvoanie vector, but about it and how it works, I do not understand. ;please help!
2. Please tell me how to read information on the cards?
;let's say in the file I have written:
;x = 500.0
;y = 500.0
;as these values are then assigned konstantamx and y?

2015-03-20 23:12:45

Hi,
Can you please stop using Google translate? It cannot interpret your language properly and does not put your sentences together properly, causing them to not make very much sense. Can you attempt, to your greatest extent, to put all of your words in english as best you can, without using a translator? You can't learn english without practicing it. Practice makes perfect, as they say.

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2015-03-20 23:52:07

There are lots of ways to make 3D maps. I've tried at least 4, that I can remember quickly.

As for reading from files, a basic example:

file datafile;
datafile.open("data.dat", "r");
string data=datafile.read();
datafile.close();

// Assuming the data is divided into lines:
string[] lines=string_split(data, "\n", true);

for(uint i=0; i<lines.length(); i++) {

// Assuming that each line is in the format <var>=<value>:
string[] parts=string_split(lines[i], "=", true); // There are other ways, but this is quickest.
if(parts[0]="x") x=string_to_number(parts[1]);
else if(parts[0]=="y") y=string_to_number(parts[1]);
// And so on, for every variable.

}// End of lines loop.
看過來!
"If you want utopia but reality gives you Lovecraft, you don't give up, you carve your utopia out of the corpses of dead gods."
MaxAngor wrote:
    George... Don't do that.

2015-03-21 18:23:38

Well, what about the vector?

2015-03-22 23:25:26

...

2015-03-23 13:56:17

If CAE Jones don't know what is a ispolzvoanie vector, I give up!  smile

2015-03-23 15:16:51

In the mathematical sense, vectors describe a magnitude and a direction. This can be used to represent position, as well as velocity, force, etc.

In BGT, vectors contain member variables x, y, and optionally z.
Most of the more complicated features come into play for physics simulations, and for audio games we can ignore quite a lot.

You'd treat vectors like other objects. For example:

// Create vectors for player position and velocity:
vector player_position(0, 0,0);
vector player_velocity(0, 0, 0);

// Set velocity to something simple, like moving to the right at 3m/s:
player_velocity.x=3.0;
// (It's possible to work in angles, rotation, etc, but this is more complicated. I'd recommend math.bgt from my includes.zip, as it has more functions for working with vectors.

// A function for getting the position of an actor (player or enemy or even bullets), given position, velocity, and time:
// This takes advantage of features of BGT's vectors
vector next_position(vector position, vector velocity, double dt) {
// (Note: time is in seconds.)
return position+(velocity*dt);
}


To be honest, I've never actually tried that trick, but I usually use geometric shapes instead of a point position vector.
If you want to update the player position using that function:

// There are different ways to get dt, depending on how your game is set up.
// If you have a game timer, it might be
// double dt=game_timer.elapsed/1000.0;

player_position=next_position(player_position, player_velocity, dt);

However, you'd want to check if the movement would go through solid objects.
It's hard to say what the best map design would be for any particular game. Tile arrays, object lists, even a shallow version of scene graphs (which are probably how most mainstream 3D games do it, but most implementations I've found are horribly complicated. This is probably because I prefer objects to represent objects or attributes, and methods to represent actions, and the scene graph implementations I've studied have it as objects all the way down. with multiple layers of abstraction and overly elaborate class names and the need to constantly check the documentation for the parameter lists for each and every level. ... You probably can get away with a tile array.)

看過來!
"If you want utopia but reality gives you Lovecraft, you don't give up, you carve your utopia out of the corpses of dead gods."
MaxAngor wrote:
    George... Don't do that.

2015-03-23 18:27:21

still do not understand!
Here we have the variables:
player_x, player_y, how do we determine where he play? or if I also want the arrow to the left to the right not to go, and to turn, how to do it?