Client Update for 0.4.6 Released (2019-05-27)

Zurix

  • Sr. Member
  • Grand Theft Co-op Developer
  • Posts: 269
Re: Client Update for 0.4.6 Released (2019-05-27)
« Reply #60,  »
Quote from Xmair on June 2nd, 01:54 PM
You guys are literally going to do nothing with the NPCs, the maximum you'll be able to achieve is making them stand in an ammunition shop as a statue, let alone writing an AI for them. Do you guys have any idea what kind of task is it to write a proper AI?

Sonmez

  • Newbie
  • Yo! It's time to play the fair game!
  • Posts: 15
if (!perfect) createAgain();

Athanatos

  • Hero Member
  • Working on maybe the best VC:MP server ever
  • Posts: 755
Re: Client Update for 0.4.6 Released (2019-05-27)
« Reply #62,  »
You can define the city nodes, and give them as input data to the AI. You can next use some mort of algoritm like the A* , Pathfinder, calculating the node shortest way with some backtracking, etc.

I said that many times but not here: Programming is not about writing code, it is about solving problems.

The problem with the newbie scripters is that they don't think 'like a programmer'. Knowing syntax isn't enough for programming (but you need to know how to write proper code), critical and abstract thinking is.

Zurix

  • Sr. Member
  • Grand Theft Co-op Developer
  • Posts: 269
Re: Client Update for 0.4.6 Released (2019-05-27)
« Reply #63,  »
Quote from Athanatos on June 4th, 04:45 PM
You can define the city nodes, and give them as input data to the AI. You can next use some mort of algoritm like the A* , Pathfinder, calculating the node shortest way with some backtracking, etc.

I said that many times but not here: Programming is not about writing code, it is about solving problems.

The problem with the newbie scripters is that they don't think 'like a programmer'. Knowing syntax isn't enough for programming (but you need to know how to write proper code), critical and abstract thinking is.
Exactly, Stormeus also have to do some cover for Vice City classes that manage Path nodes with Squrriel. Basically: CPathFind::FindNodeClosestToCoors 0x437150 (1.0) to return a node and it's structure is:
Code: [Select]
struct CPathNode {
    short m_wPathData1;
    short m_wPathData2;
    short m_wPosX;
    short m_wPosY;
    short m_wPosZ;
    char field_1[2];
    short field_2;
    char field_3[6];
};
btw here is my implementation for sandbox for VC comes with population implementation: https://github.com/ZeyadAhmed/VCSandBox/blob/master/VCSandBox/CPopulationManager.cpp#L211

Athanatos

  • Hero Member
  • Working on maybe the best VC:MP server ever
  • Posts: 755
Re: Client Update for 0.4.6 Released (2019-05-27)
« Reply #64,  »
With the current tools we can just make an big array with the game node's extracted from the game data files, and then we* can try implementing some sort of algorithm that functions like an AI.

The kind of AI in games is 'weak AI' . A set of conditions and events, That's it. 'Weak' AI is absolute garbage to the 'Powerfull' nowadays AI used in high-tech robots.
Re: Client Update for 0.4.6 Released (2019-05-27)
« Reply #65,  »
If VCMP uses SCM functions then there opcodes are enough for an NPC:
Code: [Select]
009A: $723 = create_actor_pedtype 4 model 95 at [email protected] [email protected] [email protected]
0187: [email protected] = create_marker_above_actor $2099
04F4: put_actor $2684 into_turret_on_object $714 at_object_offset -2.5 -1.996 4.179 position 0 shooting_angle 360.0 with_weapon 27  //Please add this for players too :)
0465: remove_actor $2493 from_turret_mode  //for players too pls xd
01C9: actor $2324 kill_actor $2291
01CA: actor $853 kill_player $PLAYER_CHAR
0321: kill_actor $2295
0211: actor $actor walk_to 204.3 -1288.7
0239: actor $1036 run_to 65.8 -1444.0
009B: destroy_actor_instantly $853
034F: destroy_actor_with_fade $1037 // The actor fades away like a ghost
00A1: put_actor $PLAYER_ACTOR at 482.2 -69.9 9.9
0362: put_actor $PLAYER_ACTOR at 136.457 -817.37 9.44 and_remove_from_car
01D4: actor $PLAYER_ACTOR go_to_car [email protected] and_enter_it_as_a_passenger
01D5: actor [email protected] go_to_and_drive_car [email protected]
00A7: car [email protected] drive_to 103.1 -832.3 9.317
Re: Client Update for 0.4.6 Released (2019-05-27)
« Reply #66,  »
Also let's don't forget the streaming. An easy way should be letting the server generate and calculate the AI behiavour (but since the server executable has no somewhat access to game's source, this is going to be a hard task that requires general changes to the VC:MP's code).

Stormeus

  • VC:MP Developer
  • oh god how did i get here im not good w computer
  • Posts: 1,088
Re: Client Update for 0.4.6 Released (2019-05-27)
« Reply #67,  »
Quote from Athanatos on June 4th, 07:14 PM
If VCMP uses SCM functions
It doesn't, and either way you still need to synchronize the actor's state so running SCM on the client won't cut it.
Quote from Athanatos on June 4th, 07:16 PM
An easy way should be letting the server generate and calculate the AI behiavour (but since the server executable has no somewhat access to game's source, this is going to be a hard task that requires general changes to the VC:MP's code).
Couldn't have said it better myself.

Athanatos

  • Hero Member
  • Working on maybe the best VC:MP server ever
  • Posts: 755
Re: Client Update for 0.4.6 Released (2019-05-27)
« Reply #68,  »Last edited
Quote from Stormeus on June 4th, 08:39 PM
Quote from Athanatos on June 4th, 07:14 PM
If VCMP uses SCM functions
It doesn't, and either way you still need to synchronize the actor's state so running SCM on the client won't cut it.
Thanks for breaking my dreams to make missions for vc:mp :c . And ofc you should synchronize the actor's stuff, I have a somewhat experience in game developing, I didn't say that by using SCM , you would not need to sync the peds (that's pretty dumb to say that using scm opcodes will solve this problem).

.

  • VC:MP Beta Tester
  • .
  • Posts: 1,801
.

Athanatos

  • Hero Member
  • Working on maybe the best VC:MP server ever
  • Posts: 755

Zurix

  • Sr. Member
  • Grand Theft Co-op Developer
  • Posts: 269

KrooB

  • Full Member
  • BEN TÜRKÜM
  • Posts: 116
We are his people !
Who can challange us ?

ℛḝξ☂

  • Jr. Member
  • Posts: 91
I may be a slow walker but I am always walking.

Sonmez

  • Newbie
  • Yo! It's time to play the fair game!
  • Posts: 15
if (!perfect) createAgain();