Skip to main content

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

ThatGame.exe

A cryptic puzzle game about being a bad coder. Also ducks. 路 By BobboDev

Linux version pls

A topic by Timeearl created Jun 09, 2022 Views: 359 Replies: 13
Viewing posts 1 to 3

Hi, i just came over here from the Youtube video and wanted to try out the game.

Since i'm using a Linux distro as my operating system i sadly can't play without jumping through some hoops.

It may be a niche Problem, but would it be possible for you to upload a Linux Version of your Game?

If I'm not mistaken you should be able to export to Linux directly from within Unity.

Developer

No problem, on it :) I'm on coach journey atm so hoping my laptop doesn't run out of battery, otherwise might be up a bit later.

Thank you for looking into it :D

Developer

Linux version up! Hope it works :) Sorry it took me a while! I made the Linux version and just forgot to upload it. 

Thank you for uploading it. It seems like there is a problem with level 6. The  game doesn't seem to be able to locate or read the file correctly. You mentioned in another post looking into creating the file with moving=false written in it. That may be able to fix the issue, by showing where the game accesses the file system. Otherwise i haven't found anything not working, except maybe the in game cursor being too big, but that might be a problem with my compositor and doesn't impact the functionality.

Developer (1 edit)

Hmmm let's see.. Do you use Unity by any chance?  Would you be able to test something out for me?


If not I can make a little test program to determine which directory the game is looking for.

(1 edit)

Haven't used it in a while, but i can install it for some testing.


Edit: I have Unity installed and working now.

Developer (1 edit)

Oh thanks a bunch for going out of your way to help man!

So, could you make a script - put it on an object in the scene, and put this line in:

void Start(){
    Debug.Log(Application.dataPath);
}

Then build and run a Linux version and tell me what the Player log says. I don't know how much you remember about Unity but you can find the Standalone Player log in the console tab 

[Edit] Ah, I see you make games so I'm probably over-explaining this 馃槃

  

Thanks Timeearl!!

Ok, so after some testing it seems like the <Project_Name>_Data folder is targeted by Application.dataPath, but when i tried moving a file named platformsettings.txt containing just the line "moving=true" into it, it didn't work.

I tried approximating what you did (read file, discard white spaces, ignore capitalization and compare) and the code

StreamReader reader = new StreamReader(Application.dataPath + "/platformsettings.txt");
bool platformMoving = string.Concat(reader.ReadToEnd().Where(c =>!char.IsWhiteSpace(c))).ToLower().Contains("moving=true");
Debug.Log(platformMoving);

returned True for the file "platformsettings.txt" containing

randomMOVING     =  True letters

Does your implementation differ from mine substantially?

Developer (1 edit)

hmm, mine differs a little, but not massively. I still don't see why it wouldn't work. You're doing things in a slightly more smart way, replacing all the blank spaces. This is my exact implementation

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.IO;
public class Level10 : MonoBehaviour
{
    public MovingPlatform movingPlatform;
    string normalPath;
    string normalPath2;
    public MovingPlatform bug;
    string bugPath;
    string bugPath2;
    
    void Start()
    {
        normalPath = Path.GetFullPath(Application.dataPath + @"\platformsettings.txt");
        normalPath2 = normalPath.Replace(@"\ThatGame_Data","");
        bugPath = Path.GetFullPath(Application.dataPath + @"\bugsettings.txt");
        bugPath2 = bugPath.Replace(@"\ThatGame_Data","");
    }
    void Update()
    {
        if (!movingPlatform.forceMove)
        {
            if (File.Exists(normalPath))
            {
                if (ReadString(normalPath))
                {
                    movingPlatform.forceMove = true;
                }
                
            }
            if (File.Exists(normalPath2))
            {
                if (ReadString(normalPath2))
                {
                    movingPlatform.forceMove = true;
                }
                
            }
        }
        if (PlayerPrefs.GetInt(gameObject.transform.parent.name) != 1)
        {
            if (File.Exists(bugPath))
            {
                if (ReadString(bugPath))
                {
                    bug.forceMove = true;
                }
            }
            if (File.Exists(bugPath2))
            {
                if (ReadString(bugPath2))
                {
                    bug.forceMove = true;
                }
            }
        }
    }
    
    public bool ReadString(string path)
    {
        StreamReader reader = new StreamReader(path);
        if (
            Read(path, reader, "moving = true")
         || Read(path, reader, "moving= true")
          || Read(path, reader, "moving =true")
           || Read(path, reader, "moving=true"))
        {
            reader.Close();
            return true;
        }
        else
        {
            reader.Close();
            return false;
        }
    }
    public bool Read(string path, StreamReader reader, string check)
    {
        reader = new StreamReader(path);
        if (reader.ReadToEnd().Contains(check))
        {
            reader.Close();
            return true;
        }
        else
        {
            reader.Close();
            return false;
        }
    }
}

I'm a little confused, not really sure what to suggest... I'll have a think but seems my brain isn't working this evening 馃槄Sorry about the blocked progress in the game!

Also thanks again for doing that :)

(+2)

Found the Problem. I didn't think about it before, but the file separator for Windows is "\" and for Linux it is "/". I had that problem in another project before so i'm a bit mad at myself for not noticing. The Proper way of doing it is

Path.GetFullPath(Application.dataPath + Path.DirectorySeparatorChar + filename);

Path.DirectorySeparatorChar replaces the "/" or "\".

I tested it and it works for Linux. Since it changes the char according to the Operating System it should work for Windows and Mac as well.

I created a file named ThatGame_Data\platformsettings.txt in the Folder which contains the ThatGame_Data Folder and was able to finish the Level that way xD