#~~Pokemon~~ Bot

1 messages · Page 1 of 1 (latest)

queen hamlet
#

nice, please share screenshots as you go! watching this one closely, it's graphically very cool

neon pine
#

awesome stuff! Gonna beat poketwo with those awesome graphic!

flint apex
#

Latest visual update.

flint apex
# flint apex Latest visual update.

This is:

• A command to explore the current zone
• "Rolls a dice" to see if you come across a pokemon, an item, or nothing.
• Creates the pokemon if you find one and puts it into the DB as a wild pokemon.
• Loads both pokemon from the DB (player party and wild pokemon)
• Getting the sprite based on the pokedex id.
• Slapping the background on, then the health bars (which change color based on the % of health left, and is tied to the pokemons hp), adding the status boxes, then the pokemon, then the text box, then the actual text
• Saves the picture to a folder, then loads it as an attachment for an embedded message.

#

This is the "oc" professor I'm having made for this bot/game.

flint apex
#

Devlog #2 - 9/24/23

Updates:

  • I implemented SFML to the project in order to provide all those cool graphics we love and enjoy.
  • With this, I currently have "dynamic" battle screens that can be generated. Pictures below.
  • These dynamic battle screens are intended to mimic the mainline Pokémon games. Of course the pictures wont be interactable, but buttons will be provided to allow you to battle, catch, use items, and run away. I have begun the process of creating these buttons and their functions.
  • Generating the images took me some time to get them where they're at now, but the knowledge of how I'm going to continue to approach them should speed things up somewhat.
  • On the topic of graphics, shiny Pokémon will be disabled when the beta does begin. If account wipes happen to come in the future, I'd rather people not be as upset.
  • I realize this isn't a huge update for three weeks worth of time, but I intend to have "simple battles" with wild pokemon done by the end of October and things should get way more interesting after that point. One of the most time consuming things to do will be to get every move in the game working (there's roughly 900).
  • Simple battles will be something along the lines of pokemon having access to simple moves like tackle; if it hits, it does damage and nothing else.
#

I use a command to search the current area. A wild pokemon shows (I have it set between national dex id 1 - 151) with the wild pokemons HP set to 50% and my pokemons HP set to 19% (testing purposes). My pokemon is already stored in the database under my caught pokemon and in my team. The pokemon chosen for me is taken from my team and the first one alive. The wild pokemon is generated then stored in the database. Running away will remove it from the database.

lofty drift
#

Just a quick question. Do you have some implementation for image caching? Or you draw images from begining everytime?

#

And also. Are positions and sizes of parts of images hard coded or are they coefficients so you can create images of any resolution?

flint apex
#

Each time the function is called, a new image is created. Positions and sizes are hard coded.

#

The original sprites are small. Small pokemon are like 32x32 pixels. SFML has a scale function and I double the size of everything.

flint apex
lofty drift
#

Creating and saving all possible combinations of images is a bad idea

#

You have a lot of pockemons

#

And the amount of possible combinations is mind-blowing

flint apex
#

I'm not saving all combinations kekeke

#

When you "explore" and a pokemon appears, a new image is created.

#

When you explore again and find another pokemon, the old image will be overwritten.

lofty drift
#

Well, imagine have 10k users

#

Will you store 10k images

#

And overwrite them each time?

flint apex
#

I also intend, when after you attack, the image will be overwritten with the new health bars and resent

lofty drift
#

Not very efficient thing. But it fine for beginning

flint apex
lofty drift
#

Nice

#

It is good approach

flint apex
lofty drift
#

But saving them to disk, well

flint apex
#

Each image is like <1mb iirc

lofty drift
flint apex
lofty drift
#

This way I do not utilize disk, have fast access, and caching

#

Some parts like "dominoes" are cached all the time

#

Generated once and reused

#

Chess images as well, loaded once and stays forever

#

Disk is very slow thing in computer world

#

Even best SSD is slow compared to ram

#

And not only in speed, in latency

flint apex
#

I need a way to bring fights back if the bot times out or if the bot gets restarted

lofty drift
lofty drift
#

And store just like "user fight"

#

With data

flint apex
#

Ah yeah I guess I could just recreate the image again

#

Fair fair

lofty drift
#

Well, @jade plover finishes all unfinished games with draw after restart, but you have a different situation

#

And there is system for safe shutdown

#

So it will not allow new games but will wait until the old one ends

flint apex
#

After each attack used, I'll have to save info to the db

lofty drift
#

New hp value, for example, yes

flint apex
#

Last moves used, field state, etc etc etc

lofty drift
#

But you need to do something like that anyway, no?

flint apex
#

I have some of it at the moment

lofty drift
#

You can't restore game just from image

flint apex
#

Well yeah lol

lofty drift
#

Also, are you saving PNG or jpg?

flint apex
#

Png

lofty drift
#

PNG is smaller in size but takes much more resources to create

#

As it has loseles compression

#

It is fine for now, but can cause something in future

#

Well, depends what you will be limited to. Cpu or internet

flint apex
#

If I put pngs together and save it as a jpg, the transparency from any png should not show up right?

lofty drift
#

As transparency at the end creates some color anyway

flint apex
#

Then I gotta keep it png.

lofty drift
#

Like if you have some not filled background it will begin black on jpg

#

But if you have a fully filled image it will look the same on PNG and jpg

flint apex
lofty drift
#

Saving the final image will look the same as with png

flint apex
#

Gotcha

lofty drift
#

It will be the same

#

As anyway when you put one image on another it begins being one image

#

It is not different layers like Photoshop

flint apex
#

Alright, I'll switch that over to jpg

#

I'll keep saving images though, until I at least know battles are fully working

lofty drift
#

should be one line of code to change for you 🙂

flint apex
#

It is lol

lofty drift
#

I have worked with sfml before, so ye

flint apex
#

"image.png" -> "image.jpg"

lofty drift
#

Would it override someone's images?

flint apex
#

Saved to different spots

lofty drift
#

Ok than

flint apex
#

Username/battle/image.png

#

For ex

lofty drift
#

User id

#

Not name

#

Name can be changed

#

Id not

flint apex
#

Ah yeah I do need to change that

queen hamlet
#

triviabot has 12831 cached images right now, for questions, answers, hints

lofty drift
#

I have 0 images cache, well

queen hamlet
#
trivia@ns3130725:~/www/images$ df -h
Filesystem      Size  Used Avail Use% Mounted on
udev             16G     0   16G   0% /dev
tmpfs           3.2G  330M  2.8G  11% /run
/dev/md2        412G  144G  248G  37% /

nowhere near full

lofty drift
#

But images is something which will have full redesign

queen hamlet
#

if i thought i was going to hold many hundreds of thousands however or millions i'd use cloud buckets, e.g. aws or gcloud

lofty drift
#

I use discord as place to save images

queen hamlet
#

you shouldnt - theyre changing how cdn works and adding a timestamp and expiry to the images

#

while the image remains referenced by a discord api element like an embed, it will remain valid and the expiry will refresh, but take it out of discord e.g. reference the discord cdn image on a website, the link will expire after 24h

lofty drift
#

Well, all images are runtime generated

lofty drift