Giter Club home page Giter Club logo

Comments (9)

bahrmichael avatar bahrmichael commented on August 11, 2024

Confirmed that this still is a problem in new saves.

from factorio-tycoon.

bahrmichael avatar bahrmichael commented on August 11, 2024

Couldn't find anything causing this in e33903d...87cebd0

from factorio-tycoon.

winex avatar winex commented on August 11, 2024

ooh, i think we're having this again... it's after v0.4.0

is it supposed to be like that or have i missed something?
scrot 20240310_140115 houses-are-off half

note: excavation pit had proper coords and looked centered, but house is now having a {+1,+1} position

from factorio-tycoon.

bahrmichael avatar bahrmichael commented on August 11, 2024

I haven't seen this yet. Would you mind attaching the savegame?

from factorio-tycoon.

winex avatar winex commented on August 11, 2024

hmm, i think it will happen for any town, i'll check other ones on this map (it's big, but i can shrink it) and another save
maybe it's related to town_hall position or w/e else...

  • same map: 2 towns are bugged
  • another save: can't force my lovely town to build (big, 5K citizens) - it's blocked by #186, lol
    this is v0.3.x save

moved debug logs into that bug

  • fresh newly generated town in 5K citizen save - same offset :(
    while was working on limits and PRNG stuff

btw, rbgen works in my save really good - didn't test it here, previously...

from factorio-tycoon.

winex avatar winex commented on August 11, 2024

ok, stripped-off "big" map: test.tycoon_1633975416_sands.play-3-bug-stripped.zip
2 towns has offsets (Gearford and Steamridge), but Conveyorburg being stuck with construction

from factorio-tycoon.

winex avatar winex commented on August 11, 2024

found why it's like that. when using CityPlanning:: addCity() function - position is forcefully set just as given... just imagine, it can be: {+1/3, +2/3}

but town_hall.position is always {+0.5, +0.5} (though being apparently 6x6) - we'd better always floor() it and never use it directly (mostly because of LuaEntity) as we can use City:: .center field instead.
also, tag with gps are slightly off, i.e. not perfectly centered

pushing fixes into winex:pr-2...

it's too bad that in Factorio graphics can break the code :(

edit: forcing floor() i.e.: center = { x = 2800, y = -3696 } (even from console for the above city) seems to fix new houses position. looks like it's related to rounding issues when there are 0.5s everywhere. will test positive coords...
i decided to leave tags at the start of initial grid -- to always see why it is like that ...or we can just add +1.5*CELL_SIZE later

from factorio-tycoon.

bahrmichael avatar bahrmichael commented on August 11, 2024

Thank you for addressing this issue and providing a fix! Should we close this issue @winex ?

from factorio-tycoon.

winex avatar winex commented on August 11, 2024

@bahrmichael, yes. should never appear in new version

from factorio-tycoon.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.