1. Forum moved (you can use login and pass from old forum)
  2. Many discussions moved to the bugtracker

Now with a city

Discussion in 'Coding' started by JonnyH, Sep 20, 2014.

  1. JonnyH

    JonnyH Well-Known Member Official Developer Administrator

    Joined:
    Jul 17, 2014
    Messages:
    179
    Likes Received:
    42
    Best Answers:
    0
    I've finally managed to get some time to get some progress on the city map - screenshot attached :D

    If anyone can try to build on MSVC and let me know if I've broken everything that would be great - I don't have windows to test on at the minute...

    Also note the 'cracks' in the buildings - I am in the process of fixing this - it seems to be when the tiles have some completely blank columns on the left, we don't keep those columns correctly causing the whole tile to be shifted left, causing stuff not to line up correctly....
     
  2. JonnyH

    JonnyH Well-Known Member Official Developer Administrator

    Joined:
    Jul 17, 2014
    Messages:
    179
    Likes Received:
    42
    Best Answers:
    0
    Cracks fixed :D

    You should now be able to start a game, select difficulty, and look around the city with the arrow keys. Progress!

    EDIT: there seems to be some issues on windows reading the city files. Some initial attempts of working around it are here. God knows what's happening....

    Jonny
     
  3. xracer

    xracer Registered

    Joined:
    Jul 17, 2014
    Messages:
    45
    Likes Received:
    2
    Best Answers:
    0
    That looks incredible!!!!
    You are doing awesome work man, keep it up!!!!!!!
     
  4. pmprog

    pmprog Well-Known Member Official Developer Administrator

    Joined:
    Jul 8, 2014
    Messages:
    175
    Likes Received:
    12
    Best Answers:
    0
    Nice work, if I get some time over the next couple of days, I'll take a look. Will also try and pop on IRC too
     
  5. luke83

    luke83 Xcom Modder Tester Researcher

    Joined:
    Jul 11, 2014
    Messages:
    11
    Likes Received:
    5
    Best Answers:
    0
    Good to see progress happening so fast, great work.
     
  6. kkmic

    kkmic Undefined

    Joined:
    Jul 17, 2014
    Messages:
    59
    Likes Received:
    2
    Best Answers:
    0
    It segfaults on me:

    Code:
    gdb ./OpenApoc 
    
    GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2.1) 7.4-2012.04
    Copyright (C) 2012 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
    and "show warranty" for details.
    This GDB was configured as "i686-linux-gnu".
    For bug reporting instructions, please see:
    <http://bugs.launchpad.net/gdb-linaro/>...
    Reading symbols from OpenApoc...done.
    (gdb) run
    Starting program: OpenApoc 
    [Thread debugging using libthread_db enabled]
    Using host libthread_db library "/lib/i386-linux-gnu/libthread_db.so.1".
    [New Thread 0xb556bb40 (LWP 7046)]
    [New Thread 0xb0528b40 (LWP 7047)]
    [New Thread 0xafbffb40 (LWP 7048)]
    [New Thread 0xab1feb40 (LWP 7049)]
    [New Thread 0xaa7ffb40 (LWP 7050)]
    [New Thread 0xa9dffb40 (LWP 7051)]
    [New Thread 0xa95feb40 (LWP 7052)]
    Failed to load "UFODATA/PAL_06.DAT", trying "ufodata/pal_06.dat"
    Failed to load "UFODATA/PAL_06.DAT"
    Failed to load "TACDATA/TACTICAL.PAL", trying "tacdata/tactical.pal"
    Failed to load "TACDATA/TACTICAL.PAL"
    [Thread 0xa9dffb40 (LWP 7051) exited]
    Failed to load "ufodata/citymap1", trying "ufodata/citymap1"
    Failed to load "ufodata/citymap1"                                                                                                                                                                                                                                
    Failed to open city map:citymap1                                                                                                                                                                                                                                 
    Failed to load "UFODATA/PAL_04.DAT", trying "ufodata/pal_04.dat"                                                                                                                                                                                                 
    Failed to load "UFODATA/PAL_04.DAT"                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                     
    Program received signal SIGSEGV, Segmentation fault.                                                                                                                                                                                                             
    0x0808382a in std::vector<std::vector<CityTile, std::allocator<CityTile> >, std::allocator<std::vector<CityTile, std::allocator<CityTile> > > >::operator[](unsigned int) () at /usr/include/c++/4.8/bits/stl_vector.h:771                                       
    771           { return *(this->_M_impl._M_start + __n); }                                                                                                                                                                                                        
    (gdb)      
    
    It happens after I click on any difficulty option.

    The "Failed to load 'some/file'" messages were present on my machine since day 1, though the game executed without segfaulting - the main menu and the options test screen were accessible.

    Clarification:

    The following messages were always present on my machine, when starting the game:
    Code:
    Failed to load "UFODATA/PAL_06.DAT", trying "ufodata/pal_06.dat"
    Failed to load "UFODATA/PAL_06.DAT"
    Failed to load "TACDATA/TACTICAL.PAL", trying "tacdata/tactical.pal"
    Failed to load "TACDATA/TACTICAL.PAL"
    
    Those two files are present with the exact path displayed (uppercase and all) inside my data dir.


    Now, when clicking on any difficulty options, the following messages pop up, right before the segfault:
    Code:
    Failed to load "ufodata/citymap1", trying "ufodata/citymap1"
    Failed to load "ufodata/citymap1"
    Failed to open city map:citymap1
    Failed to load "UFODATA/PAL_04.DAT", trying "ufodata/pal_04.dat"
    Failed to load "UFODATA/PAL_04.DAT"
    
    The "ufodata/citymap1" file is present, but in a uppercase-only path. The "UFODATA/PAL_04.DAT" is present as noted.

    All my files/paths are uppercase.


    On a side note, on the three screens available ATM, the mouse moves best on the difficulty screen, pretty sluggish on the main menu, and extremely sluggish on the options screen.

    On a happier note, great progress! :)
     
  7. JonnyH

    JonnyH Well-Known Member Official Developer Administrator

    Joined:
    Jul 17, 2014
    Messages:
    179
    Likes Received:
    42
    Best Answers:
    0
    kkmic: Yeah, that's a bug caused by me using the lower-case filename. On my PC (for whatever reason) the iso supplied with steam mounts with all-lowercase filenames, but some(?) have ALL UPPERCASE.

    I'll fix this.... We really should have a better way - maybe completely case-insensitive paths? And we need to make messages that are not really errors (e.g. failed to load the UPPERCASE_FILENAME, trying lowercase) clearly separate from proper errors (e.g. failed to find the file after searching both cases - expect a crash!)

    Jonny
     
  8. kkmic

    kkmic Undefined

    Joined:
    Jul 17, 2014
    Messages:
    59
    Likes Received:
    2
    Best Answers:
    0
    This is how the files were installed inside my DosBox.

    IIRC, DOS used UPPERCASE representation for directories, and lowercase representation for files. Or at least this was the convention for all DOS orthodox file managers I have used.

    Why everything got installed full caps, I have no idea.


    Indeed, there should be some way to load files in a case-insensitive way. Like OXC does.
     
  9. pmprog

    pmprog Well-Known Member Official Developer Administrator

    Joined:
    Jul 8, 2014
    Messages:
    175
    Likes Received:
    12
    Best Answers:
    0
    I never experienced this.

    In any case, files are all uppercase on the Apoc CD. The Windows build had some fixes last night if you want to try it again.

    Oh, and you might see partial buildings, you can use Page Up/Down in the Cityscape to change the Z rendering.
     
  10. JonnyH

    JonnyH Well-Known Member Official Developer Administrator

    Joined:
    Jul 17, 2014
    Messages:
    179
    Likes Received:
    42
    Best Answers:
    0
    I should have fixed this now (Read: hacked around to work with ALL_UPPERCASE or all_lowercase (ie Not MiXeD) data filenames

    The problem with filenames on windows/dos is the filesystem does actually store the case, it's just ignored for comparison by windows/dos. This means it's perfectly possible to have a ntfs/fat filesystem that contains two files that differ only by case, show up as two files in explorer, but only one can ever be accessed. I think chkdsk considers this invalid, and tries to 'fix' this...

    Annoying, yes.
     
  11. ivandogovich

    ivandogovich Registered

    Joined:
    Jul 8, 2014
    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    A lot of up votes and some nice positive feedback from the /r/xcom subreddit, when I posted the image there. :)
    http://www.reddit.com/tb/2hcb3e

    Keep up the good work, you guys. :thumbsup:

    Cheers, Ivan :D
     
  12. JonnyH

    JonnyH Well-Known Member Official Developer Administrator

    Joined:
    Jul 17, 2014
    Messages:
    179
    Likes Received:
    42
    Best Answers:
    0
    It's weird seeing something I did on my reddit frontpage....

    Thanks for the PR anyway :p
     
  13. ivandogovich

    ivandogovich Registered

    Joined:
    Jul 8, 2014
    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    PR I can do. Coding not so much. Glad to help where ever I can. :) 8)
     

Share This Page