Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Laticoda

23
Posts
12
Topics
1
Followers
1
Following
A member registered Sep 28, 2019

Recent community posts

.

hi,

https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=d107f62f...

the project will go on, in memory of my little brother

.

(7 edits)

________________________________________________________________________________________________________________

day 16 - 16 days left HALF TIME !

Hi,  i fixed orthogonal stop at destination for solo Unit.

How to manage a Turtle path-finding with walls , enemies and just-now-dead units?

As i said before, i'd like the captain to stay at the center of the group, so it should decide other's unit position, but how to walk among complex battle-field ?

If you have time, try to look and give comment here or here:

https://www.reddit.com/r/rust_gamedev/comments/hr7m3j/which_lib_do_you_use_for_p...

https://github.com/samueltardieu/pathfinding/issues/251

________________________________________________________________________________________________________________

day 17

I have done Click&Drag today and I'm making squads. Tomorrow i'll try to work on tiled and after that pathfinding.

________________________________________________________________________________________________________________

day 18

Today i tried: to implement this:

you get a kind of unit's ghost projection to show where they will land when clicking for walking destination.

It's a translation thanks to delta x ,y from selecting to choosing destination.

I did squads, so like in Command&Conquer, it's very useful to group your units inside squads.

But, i have a loop problem i think, probably MainState update function interacts with side effect from mouse or keyboard ?

The logical part seems to work but nothing graphical, tomorrow with coffee i will see clearer or do without it.

I have documentation to read and tutos on youtube to watch. Gamedev is huge working.

________________________________________________________________________________________________________________

day 19

I just killed a fucking bug with selecting squads. 24 h lost for that.

My eyes burn.  I was very close to give-up it. But i'm happy, i think i have the feature.

Important for the game play.

Next step, make Code less dirt, make my ghost projection work (equation already written but not yet tested) , integrating camera scroll, i hope tiles.

________________________________________________________________________________________________________________

day 20

My ghost projection for moving unit, and grouping squads does work in windowed mode.

There is  a strange effect with full screen mode, i've seen a post somewhere about that problem.

Now, i'd like to add scrolling camera, zoom in/out would be nice and i have no read yet Legion docs and examples.

But if i go on this way, my code is so dirt that it probably will explode.

Twenty days writing code, it's tiring, i want to break a little bit the dynamic, so i think tomorrow i will have a look on Legion to think how i can plug it to the work i have already done. I think i will use a basic pong to experiment on it Legion. Idem for tiled.

I also need to test for implementing fights logical.

"Graphics" are ugly now.

________________________________________________________________________________________________________________

day 21

I'm studying how i can add Legion library inside what is already done :

i dont want to change too much my units code, so here is the idea:

i could manage gold, food, stone,wood and population resources via ECS , so it doesn't destroy the existing code.

________________________________________________________________________________________________________________

day 22 - Ten days left

I'm trying to introduce Resources with Wood, Gold, Stone, Agriculture and Demography.

I think population for making Soldier, Builder, Peasant ...

May be somebody can help me here:

https://github.com/TomGillen/legion/issues/162

________________________________________________________________________________________________________________

day 23


Je traverse une terrible épreuve.

merci à ceux qui ont participé.

voici ma production à ce jour :

https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=d107f62f...


(1 edit)

Auto-congratulation helps

. . .

The Badges i won while fighting against compiler :

#1 Iterator maker

#2 read inside issue tab , to find if somebody else found a bug or something like that

nothing, i didnt found button to send message

Hello No Time To Play, here is may be something that will interest you:

https://craftinginterpreters.com/

(4 edits)


#1

24 h of Gamedev with Rust

https://iolivia.me/posts/24-hours-of-rust-game-dev/

and

https://iolivia.me/posts/imgui-ggez/

and

https://github.com/iolivia/imgui-ggez-starter

_____________________________________________________________________________________________

#2

https://www.redblobgames.com/

_____________________________________________________________________________________________


#3

Little tour of iterators implementation

https://blog.guillaume-gomez.fr/articles/2017-03-09+Little+tour+of+multiple+iter...

Welcome smokku !

thank you for the explanation, do you have idea how long the process could be ?

(1 edit)

hello, my jam is Legion jam [RUSTLANG] here https://itch.io/jam/legion-jam-rustlang

and i dont see it here

https://itch.io/jams

what can i do ?

(1 edit)

Graphism : Gimp , imagemagick , maybe python scripts

Audio: Audacity, jfxr , soundbible

Assets: https://opengameart.org/ ; for the animated sprites i dont know yet.

https://www.publicdomainpictures.net/

coding: sublim-text


https://jfxr.frozenfractal.com/#

http://soundbible.com/

(29 edits)

________________________________________________________________________________________________________________________________________________________________________________________________________________________________Day 1 - 1 month 3 days left.

good:

  • technic: i study ggez examples i think i can mix it with Legion library, i walk on github.
  • gameplay: it is still unclear, i think i will make resources management, army to build, commerce... ; solo game i am newbie.
  • art: i will pick free art somewhere, later; for sound i think bxfr

bad:

  • i have problem with vector of mesh on ggez, i opened a ticket here https://github.com/ggez/ggez/issues/787
  •  i have lost +2h just for drawing a fucking line, still not working ; something wrong with Point or Point2 or nalgebra, dont know


bleeding code

to read: https://docs.rs/ggez/0.5.1/ggez/graphics/struct.MeshBuilder.html#method.line 

versus

https://docs.rs/ggez/0.5.1/ggez/graphics/struct.Mesh.html#method.new_line

i can not do this

https://github.com/ggez/ggez/issues/137

https://stackoverflow.com/questions/56710423/how-do-mesh-coordinates-and-draw-coordinates-relate-to-each-other-in-ggez-librar

not read yet: ECS Legion with ggez : https://github.com/Quetzal2/game-template

________________________________________________________________________________________________________________

day 2

Today i made experimention with ggez, yesterday's problems are going to be solved, i have to answer  some people for their help.

I have to test a lot of things, because i dont master  rust nor ggez ; didnt have time to look ECS today.

________________________________________________________________________________________________________________

day 3

I am working on events detection and how to render it ; bugs +++ ; no use of legion yet.

i am stuck on trying to make iterators and cycling iterators over colors, tried enums and structs...

https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=8f8eee77...

https://www.reddit.com/r/rust_gamedev/comments/hj14zc/help_ggez_how_to_create_cy...

________________________________________________________________________________________________________________

day 4

I've done my first iterator today, but my test doesn't compile due to another problem another place. My first

cannot return reference to temporary value

I close this test to start another one easier, basic, i will try to work on a menu, to click on rectangles... yeah, i will not provide AAA in 1 month...

________________________________________________________________________________________________________________

day 5

I've fund examples for GUI and for ECS ; trying to see how i can use all of this for the project.

I try to do as simple as possible because it becomes hell when i try too complex for me.

rectangles , lines and circles to begin.

________________________________________________________________________________________________________________

day 6 - 27 days left

reading, and thinking about conception and what it could look like at the end of the month.

I thought this:  solo units are weak and screamed. On the screen, a Unit is a little square.

But when i click on it, i can tell him join the closer sergent. The segrent is a special military unit a bit stronger than a single unit.

The sergent is a promoted unit for bravour on battlefield or after costly ( gold and time) training.

On the ground , the sergent stands at the center of the formation, like FIVE on your numpad. So you can have 8 units + 1 segent at the center: it gives you a Turtle.

Turtle formation is a defensive formation, the ennemy can miss the attack more often (arrows). But a turtle moves slower and can be stroke by cavalry charge maybe ?

If you have a capitain, you can aggregate around him Elite Soldiers to get a Golden Turtle, which can command 8 Turtles around it, this is the super Turtle, etc.

To begin, square for unit, rectangle for growing formation and buildings ; circle to have perception area ; lines for path and fire.

To avoid implementing now click and drag to select unit, it think to use J for join, A for all same type unit, TAB for swipe to the next entity.

I have to do source code economy because each "feature" kills brain cells. Moral is good, i think its possible to make "something".

other ideas: little RPG side, some messengers will come ask politic or economic question ; some random events ( meteo, disease, noble wedding etc.)

The same way you build Turtle, you could put armies in boat to manage the sea commercial roads and to travel fast .

I think i should put score and to resist time against waves of barbarian, the collapse of the empire, or to extend it beyond the beginning borders.

I need walls around cities , so tree for wood, and stone for walls. Humans for soldiers. Commercials roads for money. That's enough...

________________________________________________________________________________________________________________

day 7

Brain is warm enough now. It begins.

I am "playing" with rectangles, and geometry. While studying Pong, i imagined the ball as a catapult rocket, and paddle as a wall (satellite view). Octogons will be Towers. With few textures, it's ok for me.

Today i  accidentally discovered Qix on youtube, a very basic and old game, it's one more proof that with simple things, you can get funny

effect. I think i have fixed my color problem, just divide /255.0    .

________________________________________________________________________________________________________________

day 8

I walk very slowly, but i go on. BorrowChecker let me quite for the moment ;-) .

Today, i  worked with mouse event  detection of military units while hovering it.

I met a type conversion problem, i think this is due to migration mint / nalgebra coordonate.

I understood that while walking on issue tab, i read  this https://github.com/ggez/ggez/issues/344

i feel a little bit lost just now, but i think tomorrow i will find a solution.

The goal was to transform mouse cursor into hand when it hovers a friend unit and to become a hair-cross when it hovers an enemy.

The hovered friend units should get a weak yellow alpha mask ;  and an opaque yellow surrounding  halo if selected.

Idem but with red color for ennemy.

Feel free to copy paste little snippet about that which might show an example, here

Emergency Room: Open Space here to share fix or ideas to unstick dying jammers

https://github.com/ggez/ggez/issues/792

________________________________________________________________________________________________________________

day 9

I "fixed" the type conversion problem . I use mint.

I can hover a unit, it gives "halo" . Yeah. The cursor become Crosshair upon enemy and Hand upon friend.

But... it twinkles with Default cursor upon some unit, and keeps clean upon other of the same team. Strange, don't mind for the moment, it compiles, i'm happy. No texture yet.

Tomorrow: i'll try to make my army move and kill enemies.

________________________________________________________________________________________________________________

day 10

working on movements , thinking about A star path finding. not so easy.

________________________________________________________________________________________________________________

day 11

I've got a grid, i can select units, i get absolute / indexed coordonates. No move yet.

While trying to fix loop about twinkling, i falled on big boss BorrowChecker which let me KO.

________________________________________________________________________________________________________________

day 12

I added a hashmap to check if cursor meet an unit or not.

I use match keyword , i work with option, i used Display trait.

My god it's hard to begin. i undo some part i wrote yesterday , i know how to fix the twinkling , but the new way is hard also.

Code source i read on github with ggez are arcade games and dont worry about the mouse.

It takes me so long time just to click , select and see moving. TWELVE DAYS. and they dont move yet.

Tomorrow they will, i hope.

________________________________________________________________________________________________________________

day 13 - 3 weeks left.

Coding teachs us to be humble, doesn't it ?

Good news, i fixed the twinkling, but i broke selection.

The goal:

When you click on an enemy, nothing happen if you havent selected first your own units.

If you click on your units, it toggle selected/unselected. You can join multiple units on one enemy target.

After launching a raid, everybody is unselected.

I think i was lost inside update loop, because i made vecunit, vecselectedunit, vecenemyselected, etc.

i did that to manage easier my condition, but maybe its too much. i probably miss to fill something somewhere, or update desynchronization ?

Tomorow should be better. I rewrite it clean, i should see clearer.

________________________________________________________________________________________________________________

day 14

THEY MOVE !

I can select them, unselect, hover them, get info doing this, and let them walk !

Next step:

They only go north, they dont care the destination i clicked but they know i click on the ground, so, walk.

Now, i have to calculate trigonometry, i think it will be ok. But what happen if they want to touch the same x, y ? Because i made a hashmap.

An i want them to rotate to face to face the destination.

Also, there are x,y <f32,f32> absolute and x,y <usize,usize>.

I use f32 for draw, but usize for logical in the hashmap and for the mouse.

the f32 is looking the upper-left corner, it would be more good looking if looking the center of the casebox.

Also, here i worked with static ground, but what happens with moving enemies ? I didn't mention A* yet with obstacle.

i will try to have a look about texture tomorow if i have time, i am thinking about something like Tiled.

https://www.mapeditor.org/

________________________________________________________________________________________________________________

day 14

Since yesterday i feel happy to work with it !

Because results begin to come, after a fucking hard wall.

So, I have green and red squares 32x32 pixels, i have a grid, i hover them, they get an extra alpha , i click on them they are selected and yellow surrounded, i click on the ground they move, and we have a grey transparent  line from them to the destination.

The problems i met:

- the closer rect was to the destination, the slower it goes. I had to normalize (i think this is the word?) so taking account of the distance.

- i thought that all my green and red rects would stop a the destination ( i can mmulti-select my rects), but in fact, they go on the same

direction but to far because they didn't stop => they finish to go outside the border of the window, but the grey line remains so, they are still in memory i think.

No rotation yet, maybe i will forget it ;

no multi-waypoint yet, no click and drag yet, no A star.

I dont know yet how to manage green and red confrontation dur to hashmap. Simpler is that they block each other, i fear crash at runtime.

Talking about crash at runtime, i did have my first one today:

For the moment my Unit struct is like this:


type Straf_2f32 = ggez::mint::Vector2<f32>;

type caseXY = (usize, usize);

#[derive(Copy, Clone, Debug,PartialEq)]
struct Unit {
    rect: Rect,
    velocity: Straf_2f32,
    hovered: bool,
    enemy: bool,
    selected: bool,   
    next_pos_to_go: Option<Point2<f32>>,   
    next_case_to_go: Option<caseXY>,
    //roadmap: Vec<Point2<f32>>,
}

I lost time here: with managing to draw an "optional line".

When i just launch , i don't have time to select my units and to assign them a destination, so, i met None at next_pos_to_go, so,

when i want to draw the grey line which shows the walking way, it gives Runtime crash.

I solved it like this, with this mehod implementing Unit, i call it inside the EventHandler's draw:


fn draw_destination_line (&self, ctx: &mut Context) -> GameResult<()> {



        // https://users.rust-lang.org/t/help-with-pattern-matching-options/4267/6



        // MEMO: conditions multiples       if age > 18 && (age == 20 || age == 24) {
        //    foobar();
        //}



        match self.next_pos_to_go {
            
            Some(foobar) => { println!("{:?} {:?}", &self.next_pos_to_go, foobar);
                let (origin, dest) = (mint::Point2{x: self.rect.x, y: self.rect.y}, mint::Point2{x: self.next_pos_to_go.unwrap().x, y: self.next_pos_to_go.unwrap().y});
                let line = graphics::Mesh::new_line(ctx, &[origin, dest], 3.0, weak_white_color)?;
                graphics::draw(ctx, &line, (mint::Point2{x: 0.0, y: 0.0},))?;



        },            



            None => {} // pass
        }



        Ok(())



    }

I failed today with if let Some ...

Also, i tried screenshot, it compiles, it does not crash but any idea where the screenshot goes.

You can answer if you know:  https://github.com/ggez/ggez/issues/796

________________________________________________________________________________________________________________

day 15

I have to manage activity status for my units (sleeping, walking, fighting...) .

It will interact with finishing a task like joining waypoint on the roadmap. I want only one unit at a position even if i do possible merging

units into one bigger later.

So, i feared a crash at runtime for the hashmap ((position_x, position_y), unit) but in fact it crash another place:

 ................____________________Update EventHandler________________.........................
 Distance is ....    0
 CLOSE !!!
 waiting at destination !
 Distance is ....    0
 CLOSE !!!
 waiting at destination !
Some(Point2 { x: 714.9461, y: 564.0787 }) Point2 { x: 714.9461, y: 564.0787 }
Error: LyonError("Trying to build mesh with < 3 vertices, this is usually due to invalid input to a `Mesh` or MeshBuilder`.")

Also:

A problem i met was that unit moves like a bullet, and it goes through the destination and go too far ; i though i will give a magnetic effect, so that if the unit is very close (<32 pixel , my grid size) so the unit will do a kind of little jump and stop there at perfect place.

What i discovered is that comparing values inside a match pattern is not intuitive.

Have a look here:

https://stackoverflow.com/questions/47852269/can-i-use-and-in-match

https://doc.rust-lang.org/1.6.0/book/patterns.html#guards

Others texts i read today:

https://github.com/mattyhall/rs-tiled

https://github.com/samueltardieu/pathfinding

https://dev.to/sobertkaos/simple-2dcamera-system-for-rust-with-ggez-2o2h

________________________________________________________________________________________________________________

day 16

Exceed maximum characters, please follow here to read next:

https://itch.io/jam/legion-jam-rustlang/topic/884406/laticodas-roman-empires-diary-part-2-

thank you leafo, i just published it, i am waiting refreshing website to check.

hello, my gamejam is not pulished yet, i dont know why, if anybody can give me some info ...

hello, mine is invisible ?

Hi, i am hosting this : https://itch.io/jam/11808/preview

The goal is to share code source to learn or teach in a pleasant way. this one is not ranked. it's the first time i am host.

hi everybody,

I'd like to launch a gamejam max 7days. Open source code with possible langage : python3, gdscript or rust. Team work accepted.

Theme would be about to clone a 

PC famous game born 1980-1999.

Ugly assets not a problem.

I have no server, i can just deposit on github or MEGA.

How can i organize this kind of jam ?

Where to post ? I dont like facebook or twitter.

Thanks.