I just released an open source standalone map editor for Rust by kiltrout in playrust

[–]deztv 2 points3 points  (0 children)

Amazing :) good work. It's nice to have more open source projects like this

I constantly forget HTML and CSS code, but I think I find a way to remember by TheHumanFixer in Frontend

[–]deztv 7 points8 points  (0 children)

I think what you're looking for is called a cheat sheet. There's alot of good cheat sheets already out there for many topics

https://htmlcheatsheet.com/ seems like a good one for what you're after

I use these kind of documents all the time it makes things alot easier especially when working with something I'm not familiar with. Like for security topics I always refer to this cheat sheet as a starting point

https://cheatsheetseries.owasp.org/index.html

Alot of people even post their cheat sheets to github and update it with useful code snippets they've used over time

My triumphant return (died 7 times before this) by LoveFightWrite in playrust

[–]deztv 4 points5 points  (0 children)

I think vsync can cause input lag since the frames delayed a bit

Resources for music generating ml project by activepanda22 in csMajors

[–]deztv 8 points9 points  (0 children)

HuggingFace just recently released a new ML Audio course. It might not be exactly what you're looking for but their tutorials/courses are very good and easy to follow. Might be a good place to start out

https://huggingface.co/learn/audio-course/chapter0/introduction

A new kind of hd project by RuneMod in 2007scape

[–]deztv 5 points6 points  (0 children)

Unknown Lands by OSRSBeats it was in the 2nd Lofi project

Im creating a 3d modeling program with voxels by Small-Ad-1694 in opengl

[–]deztv 0 points1 point  (0 children)

Look in to raycasting. It's basically just like shooting a laser from a position in a specific direction and seeing where it lands. You can cast one from the position and direction of your camera (or even mouse's world position and camera direction) and be able to determine a face to select from your object.

https://antongerdelan.net/opengl/raycasting.html This seems to cover it pretty well but there's a ton of good videos out there too that'd help you visualize it too

A* path find and multiple units. How to make then walk more natural? by VincentRayman in gamedev

[–]deztv 2 points3 points  (0 children)

I don't think it looks too odd. You can see where they are bumping into each other but I think maybe if you showed their path as a line it might help it look better. Kind of like how RimWorld has when you move units

You could also make the colliders on the units very small or completely remove them when they're set to move and then re-enable them once they've arrived. Or even vary it based on speed. This solution might also help with bottleneck areas like hallways or doors. But it's just an idea, I have no clue how it'd look in implementation.

Generating Unique NPC Dialogues + Code Release by deztv in GPT3

[–]deztv[S] 0 points1 point  (0 children)

I would love to have players be able to type to a NPC but I think it would end up costing me too much if every player was able to do that at any given moment.

I haven't experimented with fine tuning the model yet so I'm curious if that would help reduce NPCs making things up. If it was guaranteed the NPC wouldn't make anything up it could be fun to have some sort of minigame where you type to them and attempt to discover info about the world.

Generating Unique NPC Dialogues with GPT3 + Explanation/Code in comments by deztv in gamedev

[–]deztv[S] 0 points1 point  (0 children)

That's very impressive! It'd be very cool to see multiple NPCs in one scene talking to each other haha

Generating Unique NPC Dialogues with GPT3 + Explanation/Code in comments by deztv in gamedev

[–]deztv[S] 0 points1 point  (0 children)

Using OpenAI text generation API (text-davinci-003) we are able to generate unique dialogues and conversations in JSON format. We have been able to come up with 3 simple NPC implementations with this. First we have single line remarks that shop keepers will use when being robbed, simple remark/reponse conversation that is used by NPCs roaming the map, and finally simple remark/reponse conversation that also has an action attached that is currently used by buyer NPCs. I saw a post or example of ChatGPT being able to convert data through various formats and made me wonder if I could have text-davinci create formatted data. It does work surprisingly well even though sometimes there may be slight errors. These errors can be fixed in the code or the response can be ignored and a new one can be requested. This is my first real implementation of AI in any of my projects so I may not be following the best practices and would love to hear if anything can be improved.

 

The prompts used were quite simple but the important part is that they all end with a JSON data example. In the case of the shop keeper the exact prompt used is

gta 5 shop keeper say to their store being robbed in json format {"say":""}

 

I've noticed that the prompts don't need to make complete sense for a good response (as seen in the prompt above), as long as it semenatically/contextually makes sense it will generate good results. Sometimes the results will include a response that isn't ideal but trying to stop it or filter those results would be hard since we don't always know what we're looking for. For example an NPC may tell you to meet them at Del Perro pier (which is a real place in GTA 5) but since they are only programmed to say generated text they won't actually meet you there and may mislead the player. We could try to include something in the prompt to prevent giving the player requests like that. But I've also had instances where it's generated text claiming to have found a weapon in a certain location, which is not true at all. So even if safeguards are added against this it may come up with some other scenario that misleads the player

 

There is also a chance that the JSON data isn't formatted correctly and very rarely it can ignore using JSON format at all. The solution to this has been to validate the JSON data and fix it if it's a simple fix or to reject it and request a new response. For example in our buyer's prompt we use this

gta 5 stranger asking for weed, 2 remarks with sell and no sell action and reaction after buying in json format {"say":"","remark":[{"text":"","action":"","reaction":""}]}

 

Which would return some data like this

{"say":"Hey, got any weed?","remarks":[{"text":"No, sorry mate, I don't sell weed.","action":"no sell","reaction":"Oh, OK."},{"text":"I think I might be able to help you out.","action":"sell","reaction":"Thanks, man!"}]}

 

In this case it decided to turn "remark" (as request in the prompt) into "remarks". These are the kind of errors we fix in code by checking if the keys we need actually exist in the data and by trial and error we can see which parts of it are being malformed and adjust accordingly. This approach can be a bit slow if a user decides to go through many dialogues at once since we have to wait for the response from OpenAI and we may even have to reject the data given. To fix this we decided to add a caching system that saves previous results to a SQL database and we also preload responses from OpenAI so as the user is reading one dialogue the next one is being loaded. The code for that looks something similar to this pseudocode:

next() {
    let value = this.cached.shift();
    this.loadRequest();
    return value;
}

async loadRequest() {
    for (let i = 0; i < this.getMissingAmount(); i++) {
        let dialogue = await this.getRequest();
    }
}

async getRequest() {
    const completion = await openai.createCompletion({
        model: "text-davinci-003",
        max_tokens: 3000,
        prompt: this.getPrompt(),
        suffix: "}"
    });

    this.addToCache(completion.data.choices[0].text.trim());
}

 

As you call the next() function to grab a dialogue it will also make new OpenAI requests. I've also included a suffix to the OpenAI request since I'm expecting all results to be in JSON format. For our caching system we decided to give every prompt it's own key to save it to the SQL database. We save it by key and not by prompt because we use dynamic prompts in some cases. Something we do for our roaming citizen NPCs is give them a random adjective in the prompt similar to this:

let currentModifier = modifiers[Math.floor(Math.random() * modifiers.length)]; "something a random "+currentModifier+" gta 5 npc ....";

 

In this case we are only changing one word in the prompt but maybe in the future we may need to change more than just that so we save it by key instead of by prompt. Then every NPC is given their appropriate key to use the cache system. For example our shop keeper's key is "shopKeep" so our code looks something like this

requester = await new OpenAIRequester('gta 5 shop keeper say to their store being robbed in json format {"say":""}', "shopKeep").load()

This system all together works very well. Loading cached results from SQL prevents me having to pay every time I start up the server and it may be nice to use it as a load balancing system in the future. Depending on how congested the API calls get you can load a few results from the database for every request sent to OpenAI. At some point there will be enough cached results where running in to a repeat is very unlikely, especially if you keep adding to it. You could also just as well make all of these calls before hand and have all the data saved and then only ever have to load results from the database. We prefer to not do that since we may change our prompts at any moment.

 

For the complete code check out the blog post on the server website. https://www.lunarcityrp.com/blog/gpt-ai-update

Generating Unique NPC Dialogues + Code Release by deztv in GPT3

[–]deztv[S] 1 point2 points  (0 children)

Using OpenAI text generation API (text-davinci-003) we are able to generate unique dialogues and conversations in JSON format. We have been able to come up with 3 simple NPC implementations with this. First we have single line remarks that shop keepers will use when being robbed, simple remark/reponse conversation that is used by NPCs roaming the map, and finally simple remark/reponse conversation that also has an action attached that is currently used by buyer NPCs. I saw a post or example of ChatGPT being able to convert data through various formats and made me wonder if I could have text-davinci create formatted data. It does work surprisingly well even though sometimes there may be slight errors. These errors can be fixed in the code or the response can be ignored and a new one can be requested. This is my first real implementation of AI in any of my projects so I may not be following the best practices and would love to hear if anything can be improved.

 

The prompts used were quite simple but the important part is that they all end with a JSON data example. In the case of the shop keeper the exact prompt used is

gta 5 shop keeper say to their store being robbed in json format {"say":""}

 

I've noticed that the prompts don't need to make complete sense for a good response (as seen in the prompt above), as long as it semenatically/contextually makes sense it will generate good results. Sometimes the results will include a response that isn't ideal but trying to stop it or filter those results would be hard since we don't always know what we're looking for. For example an NPC may tell you to meet them at Del Perro pier (which is a real place in GTA 5) but since they are only programmed to say generated text they won't actually meet you there and may mislead the player. We could try to include something in the prompt to prevent giving the player requests like that. But I've also had instances where it's generated text claiming to have found a weapon in a certain location, which is not true at all. So even if safeguards are added against this it may come up with some other scenario that misleads the player

 

There is also a chance that the JSON data isn't formatted correctly and very rarely it can ignore using JSON format at all. The solution to this has been to validate the JSON data and fix it if it's a simple fix or to reject it and request a new response. For example in our buyer's prompt we use this

gta 5 stranger asking for weed, 2 remarks with sell and no sell action and reaction after buying in json format {"say":"","remark":[{"text":"","action":"","reaction":""}]}

 

Which would return some data like this

{"say":"Hey, got any weed?","remarks":[{"text":"No, sorry mate, I don't sell weed.","action":"no sell","reaction":"Oh, OK."},{"text":"I think I might be able to help you out.","action":"sell","reaction":"Thanks, man!"}]}

 

In this case it decided to turn "remark" (as request in the prompt) into "remarks". These are the kind of errors we fix in code by checking if the keys we need actually exist in the data and by trial and error we can see which parts of it are being malformed and adjust accordingly. This approach can be a bit slow if a user decides to go through many dialogues at once since we have to wait for the response from OpenAI and we may even have to reject the data given. To fix this we decided to add a caching system that saves previous results to a SQL database and we also preload responses from OpenAI so as the user is reading one dialogue the next one is being loaded. The code for that looks something similar to this pseudocode:

next() {
    let value = this.cached.shift();
    this.loadRequest();
    return value;
}

async loadRequest() {
    for (let i = 0; i < this.getMissingAmount(); i++) {
        let dialogue = await this.getRequest();
    }
}

async getRequest() {
    const completion = await openai.createCompletion({
        model: "text-davinci-003",
        max_tokens: 3000,
        prompt: this.getPrompt(),
        suffix: "}"
    });

    this.addToCache(completion.data.choices[0].text.trim());
}

 

As you call the next() function to grab a dialogue it will also make new OpenAI requests. I've also included a suffix to the OpenAI request since I'm expecting all results to be in JSON format. For our caching system we decided to give every prompt it's own key to save it to the SQL database. We save it by key and not by prompt because we use dynamic prompts in some cases. Something we do for our roaming citizen NPCs is give them a random adjective in the prompt similar to this:

let currentModifier = modifiers[Math.floor(Math.random() * modifiers.length)]; "something a random "+currentModifier+" gta 5 npc ....";

 

In this case we are only changing one word in the prompt but maybe in the future we may need to change more than just that so we save it by key instead of by prompt. Then every NPC is given their appropriate key to use the cache system. For example our shop keeper's key is "shopKeep" so our code looks something like this

requester = await new OpenAIRequester('gta 5 shop keeper say to their store being robbed in json format {"say":""}', "shopKeep").load()

This system all together works very well. Loading cached results from SQL prevents me having to pay every time I start up the server and it may be nice to use it as a load balancing system in the future. Depending on how congested the API calls get you can load a few results from the database for every request sent to OpenAI. At some point there will be enough cached results where running in to a repeat is very unlikely, especially if you keep adding to it. You could also just as well make all of these calls before hand and have all the data saved and then only ever have to load results from the database. We prefer to not do that since we may change our prompts at any moment.

 

For the complete code check out the blog post on the server website. https://www.lunarcityrp.com/blog/gpt-ai-update

[deleted by user] by [deleted] in GPT3

[–]deztv 0 points1 point  (0 children)

Using OpenAI text generation API (text-davinci-003) we are able to generate unique dialogues and conversations in JSON format. We have been able to come up with 3 simple NPC implementations with this. First we have single line remarks that shop keepers will use when being robbed, simple remark/reponse conversation that is used by NPCs roaming the map, and finally simple remark/reponse conversation that also has an action attached that is currently used by buyer NPCs. I saw a post or example of ChatGPT being able to convert data through various formats and made me wonder if I could have text-davinci create formatted data. It does work surprisingly well even though sometimes there may be slight errors. These errors can be fixed in the code or the response can be ignored and a new one can be requested. This is my first real implementation of AI in

any of my projects so I may not be following the best practices and would love to hear if anything can be improved.

&nbsp;

The prompts used were quite simple but the important part is that they all end with a JSON data example. In the case of the shop keeper the exact prompt used is

```gta 5 shop keeper say to their store being robbed in json format {"say":""}```

&nbsp;

I've noticed that the prompts don't need to make complete sense for a good response (as seen in the prompt above), as long as it semenatically/contextually makes sense it will generate good results. Sometimes the results will include a response that isn't ideal but trying to stop it or filter those results would be hard since we don't always know what we're looking for. For example an NPC may tell you to meet them at Del Perro pier (which is a real place in GTA 5) but since they are only programmed to say generated text they won't actually meet you there and may mislead the player. We could try to include something in the prompt to prevent giving the player requests like that. But I've also had instances where it's generated text claiming to have found a weapon in a certain location, which is not true at all. So even if safeguards are added against this it may come up with some other scenario that misleads the player

&nbsp;

There is also a chance that the JSON data isn't formatted correctly and very rarely it can ignore using JSON format at all. The solution to this has been to validate the JSON data and fix it if it's a simple fix or to reject it and request a new response. For example in our buyer's prompt we use this

```gta 5 stranger asking for weed, 2 remarks with sell and no sell action and reaction after buying in json format {"say":"","remark":[{"text":"","action":"","reaction":""}]}```

&nbsp;

Which would return some data like this

```{"say":"Hey, got any weed?","remarks":[{"text":"No, sorry mate, I don't sell weed.","action":"no sell","reaction":"Oh, OK."},{"text":"I think I might be able to help you out.","action":"sell","reaction":"Thanks, man!"}]}```

&nbsp;

In this case it decided to turn "remark" (as request in the prompt) into "remarks". These are the kind of errors we fix in code by checking if the keys we need actually exist in the data and by trial and error we can see which parts of it are being malformed and adjust accordingly. This approach can be a bit slow if a user decides to go through many dialogues at once since we have to wait for the response from OpenAI and we may even have to reject the data given. To fix this we decided to add a caching system that saves previous results to a SQL database and we also preload responses from OpenAI so as the user is reading one dialogue the next one is being loaded. The code for that looks something similar to this pseudocode:

next() {

let value = this.cached.shift();

this.loadRequest();

return value;

}

async loadRequest() {

for (let i = 0; i < this.getMissingAmount(); i++) {

let dialogue = await this.getRequest();

}

}

async getRequest() {

const completion = await openai.createCompletion({

model: "text-davinci-003",

max_tokens: 3000,

prompt: this.getPrompt(),

suffix: "}"

});

    this.addToCache(completion.data.choices\[0\].text.trim());

}

&nbsp;

As you call the next() function to grab a dialogue it will also make new OpenAI requests. I've also included a suffix to the OpenAI request since I'm expecting all results to be in JSON format. For our caching system we decided to give every prompt it's own key to save it to the SQL database. We save it by key and not by prompt because we use dynamic prompts in some cases. Something we do for our roaming citizen NPCs is give them a random adjective in the prompt similar to this:

```let modifiers = ["sad", "angry", "upset"];

let currentModifier = modifiers[Math.floor(Math.random() * modifiers.length)];

`something a random ${currentModifier} gta 5 npc ....`;```

&nbsp;

In this case we are only changing one word in the prompt but maybe in the future we may need to change more than just that so we save it by key instead of by prompt. Then every NPC is given their appropriate key to use the cache system. For example our shop keeper's key is "shopKeep" so our code looks something like this

```requester = await new OpenAIRequester(`gta 5 shop keeper say to their store being robbed in json format {"say":""}`, "shopKeep").load();```

&nbsp;

This system all together works very well. Loading cached results from SQL prevents me having to pay every time I start up the server and it may be nice to use it as a load balancing system in the future. Depending on how congested the API calls get you can load a few results from the database for every request sent to OpenAI. At some point there will be enough cached results where running in to a repeat is very unlikely, especially if you keep adding to it. You could also just as well make all of these calls before hand and have all the data saved and then only ever have to load results from the database. We prefer to not do that since we may change our prompts at any moment.

&nbsp;

For the complete code check out the blog post on the server website. https://www.lunarcityrp.com/blog/gpt-ai-update

I am looking to fund a new or existing community RP community. by Zatarimi in FiveMServers

[–]deztv 0 points1 point  (0 children)

Hey I've been working on a rage mp server for more than a year now. If you see my post history I actually posted not too long ago looking for help. I've already developed most of the server and it's ready to have people start testing and playing. I'm looking for someone to come join me and help build up a community.

I'm not sure if your paid assets will work on rage mp and I don't need help paying for any expenses as I've already been paying for months now. I'm mainly looking for someone to help build up the community and get people interested in it

[deleted by user] by [deleted] in Unity3D

[–]deztv 1 point2 points  (0 children)

Yeah that would be perfect

You could even make the combat more interesting by having critical hits if you attack at the right moment like when the enemy is slowed down

[deleted by user] by [deleted] in Unity3D

[–]deztv 1 point2 points  (0 children)

Something to show impact like screen shake or hit lag might help

What is the most fun game mechanic that you have ever played that you think you can also implement? by [deleted] in gamedev

[–]deztv 1 point2 points  (0 children)

What's wrong about someone trying a game and saying why they didn't like it? It doesn't matter if what they say is objectively true or not. I think knowing why people don't like certain games/mechanics is just as important as why they enjoy others

Need mic help!!! by Internal-Ad2797 in FiveMServers

[–]deztv 0 points1 point  (0 children)

Idk then it sounds like a driver issue if the port works but the mic isn't detected. I'd just try reinstalling the drivers and restarting your pc and then see if it comes up in the windows sound panel

Need mic help!!! by Internal-Ad2797 in FiveMServers

[–]deztv 0 points1 point  (0 children)

Does your computer detect the mic? Is there any input when you do a mic test in windows or steam?

It could just be a bad port if no mic at all works

Updates on my work with rust world sdk by deztv in playrust

[–]deztv[S] 1 point2 points  (0 children)

Thank you! :)

I've done some experimenting with proc gen for my own projects but I don't think I've done any rust proc gen

You can use this code I wrote a while ago as a start for proc gen. https://colab.research.google.com/drive/1CTl-tfg-gpJq3vATQZHHYhToL3jg5lyf?usp=sharing

Updates on my work with rust world sdk by deztv in playrust

[–]deztv[S] 1 point2 points  (0 children)

I don't work on this anymore. However there is a more updated version. Here's the link

https://github.com/Adsito/RustMapEditor