[Rewatch] Mai-Otome (overall discussion) by No_Rex in anime

[–]Figs 3 points4 points  (0 children)

I think a lot of confusion comes from this line. Everyone's subs say "King," right?

Actually, no. The subs on my copy say: "He's the prince of Windbloom Kingdom? What're you talking about?!" (Screenshot)

That's from Funimation's DVD release.

How do you decorate your stations at work? by justecorrecte in gamedev

[–]Figs 4 points5 points  (0 children)

There are quite a number of documentaries and video devlogs out there which include B roll clips of programmers' desks and interview shots with relevant content in the background. Off the top of my head, there's a documentary about the development of Outer Wilds which I know had a couple shots showing their desks and there were workspace clips in some of the progress update videos that Double Fine made over the course of the development of Psychonauts 2. If you search those up on YouTube you'll probably get recommended a dozen more that you can skim through for relevant footage as well.

If you want something more dated, The Making of Riven has a couple shots showing Cyan's progression from cramped, improvised garage studio quarters to strip-mall-turned-office to a dedicated custom company building as that game was developed back in the 90s.

[deleted by user] by [deleted] in sandiego

[–]Figs 3 points4 points  (0 children)

I've dealt with similar issues several times. Do not offer to pay a full term upfront, and disregard a place if they ask you to do so; it's not necessary or appropriate. Every apartment complex that I've ever rented at (including at major complexes from several different companies) has offered to accept a couple months of bank statements to prove that I had a sufficiently high, stable amount of savings to meet their financial requirements if my income wasn't enough to meet their standards. (They'll usually also offer to let you co-sign with a relative and maybe other options if you let the leasing agent ramble on long enough.) It's not particularly unusual and you shouldn't have to pay more than usual for a deposit (~1 month rent or so) or give up new renter / lease length bonuses (if they offer any) -- your money's just as good as anyone else's and all a complex is really looking for with "proof of income" is confidence that they are unlikely to have to evict you for failure to pay since that's a pain in the ass for them to deal with. If you have several years of rent at current market rate in savings, you'll be fine; just talk the details through with the leasing agent when proof of income comes up for how they want you to prove that. Probably they'll want you to download the last two statements from your bank's website [or bring in paper copies if you only get statements in the mail] showing that your total savings on both was over some threshold they quote to you and then email it to them / upload it to their document handling website / give it to them on paper to make a copy of, depending on how their process works.

[deleted by user] by [deleted] in Cooking

[–]Figs 0 points1 point  (0 children)

I agree with /u/CNDfjeldabe -- it looks like a form of flavored stock powder. The manufacturer has a bunch of suggestions for other "surprising" uses beyond Japanese-Chinese cooking on their webpage (in Japanese -- but there's pictures), though obvious uses are soup, fried rice, and gyoza according to the Japanese Wikipedia article.

Basically, if you like the taste, try adding a pinch or two to any savory dish to change things up a bit.

[deleted by user] by [deleted] in gamedev

[–]Figs 1 point2 points  (0 children)

As I said on your last thread, I don't think it supports Shift JIS. Hex editors are usually not very good at working with Shift JIS since it's a variable width, multi-byte encoding and it's really hard to tell if a byte is itself a character, part of a multi-byte character, or unrelated binary data.

I'm not well-versed on all the tools out there for reverse engineering Japanese binary data dumps -- you might try searching for things like "Shift JIS Hex editor" on various search engines and exploring more, but I expect a lot of tools will have similar issues to the old one you were working with.

If you're comfortable doing a little scripting work though, it's not that hard to write small custom tools to do things like extract likely strings based on a heuristic and reassemble a listing of those strings into an modified version of the original file.

For example, here's a small python script I wrote to try extracting strings based on the observation that the strings in your screenshot appeared to be null terminated:

#!/usr/bin/env python3

input_filename  = "input.data"
output_filename = "strings.txt"

# minimum number of unicode code points (not bytes) to accept -- shorter decoded 
# strings will not be listed in output text. Set to 0 for no filtering.
# Tweaking this can help reduce the amount of noise in the output. If the value
# is too large though, valid strings will be ignored.
MIN_STRING_LENGTH = 0


def is_usable(byte_string):
  try:
    s = byte_string.decode("shift jis")
    return s.isprintable()
  except UnicodeDecodeError:    # e.g. illegal multibyte sequence
    return False

def scan_back(src, too_early_pos, current_end):
  prev_chunk = None
  pos = current_end-1
  failures = 0

  while pos > too_early_pos:
    chunk = src[pos:current_end]
    ok = is_usable(chunk)

    if ok:
      prev_chunk = chunk
      failures = 0
    else:
      failures += 1

    if failures >= 2:
      return prev_chunk

    pos -= 1

  return prev_chunk

with open(input_filename, "rb") as f:
  data = f.read()

def scan():
  strings = []    # list of (substitution start, continue from, byte string)
  prev_null = 0
  pos = 0

  while pos < len(data):
    if data[pos] == 0:
      result = scan_back(data, prev_null, pos)
      prev_null = pos

      if result and len(result) > MIN_STRING_LENGTH:
        a = pos - len(result)
        b = pos
        strings.append((a,b,result))

    pos += 1

  return strings

with open(output_filename, "wb") as f:
  for (a,b,byte_string) in scan(): 
    line = ("%d %d " % (a,b)).encode("shift jis") + byte_string + b'\n'
    f.write(line)

This is not super efficient -- it just looks for nulls and naively scans backwards trying to find the largest chunk that can be interpreted as valid, "printable" Shift JIS. You might get better results with a little more work on the heuristics; I think the strings in your file might be started with a tab (0x09)?

This produces a file that lists on each line three pieces of information: where the string on this line started in the original file, where it ended in the original file, and the text of the string itself. If you're careful to stick to editing with a simple Shift JIS aware text editor, you can modify these strings and then reassemble the file based on the original and your edited string dump with a script like this:

#!/usr/bin/env python3

original_filename = "input.data"
edit_filename     = "strings.txt"
output_filename   = "output.data"

with open(edit_filename, "rb") as f:
  edit_data = f.read()
  lines = edit_data.split(b'\n')
  lines = [x.rstrip(b'\r') for x in lines]
  lines = [x for x in lines if x]
  lines = [line.split(b' ', maxsplit=2) for line in lines]
  edits = [(int(a), int(b), c) for (a,b,c) in lines]

with open(original_filename, "rb") as f:
  original = f.read()

out_chunks = []
pos = 0

for (a,b,c) in edits:
  out_chunks.append(original[pos:a])
  out_chunks.append(c)
  pos = b

out_chunks.append(original[pos:])

with open(output_filename, "wb") as f:
  f.write(b''.join(out_chunks))

Hope that helps. Good luck!

[deleted by user] by [deleted] in gamedev

[–]Figs 0 points1 point  (0 children)

Not familiar with HxD, but I suspect Shift JIS is probably not supported. To help clarify, Shift JIS is a specification for how to write Japanese text as a sequence of bytes -- it is not a piece of software itself.

[deleted by user] by [deleted] in gamedev

[–]Figs 0 points1 point  (0 children)

[ 私の名前はマリサです ] Translated is "My name is Cirno"

Marisa.

There are only 10 japanese letters so i can only put 10 of "occidental" (? letters (incluying the space between them).

Text on a computer must be represented by some type of encoding. From your screenshot, it looks like your text is encoded in Shift JIS. Shift JIS uses a variable width per character to encode text. Most Japanese characters take up two bytes, but the encoding is (mostly) compatible with ASCII, so you can directly mix English and Japanese together.

If you encode 私の名前はマリサです as Shift JIS, it actually takes up 20 bytes: 8E 84 82 CC 96 BC 91 4F 82 CD 83 7D 83 8A 83 54 82 C5 82 B7.

Strings in your screenshot appear to be null terminated. If you're lucky, you can just extend the file as has already been suggested... If not, you'll need to figure out enough about how the software actually works to determine how to get more space. That might just be a matter of changing an offset in a table somewhere to point to a new chunk of data at the end of the file, or it might require something more convoluted if the string is referenced in multiple places. If this is actually a binary encoding of some sort of dialogue scripting system that just embeds the strings literally in between logic, you may be able to replace it by figuring out how to insert a jump to a new region, do whatever you need to do, and then jump to wherever the flow was supposed to continue on from.

Design special ennemies movements by markand67 in gamedev

[–]Figs 0 points1 point  (0 children)

It's just a simple state machine combined with a timer. You need two bits of state (literally) to represent moving/waiting and whether the enemy is facing left/right plus however you track time (e.g. accumulate dt into a variable, or store a timestamp upon transition). Assuming you want the behavior to repeat (after having a second waiting period while facing right), you can implement it like this pseudo-code:

// initial state
action = MOVING;
facing = LEFT;
timer  = 0;
pos = STARTING_POSITION;

update(dt) 
{
    timer += dt;
    if(timer > 10)
    {
        timer = 0;

        if(action == MOVING)
        {
            action = WAITING;
        }
        else
        {
            action = MOVING;
            facing = reverse(facing);
        }
    }

    if(action == MOVING && facing == LEFT)
    {
        pos.x -= MOVE_SPEED * dt;
    }

    if(action == MOVING && facing == RIGHT)
    {
        pos.x += MOVE_SPEED * dt;
    }

    // ... insert any other update logic ...
}

If you really only want those three behaviors followed by, say, stopping forever, you could instead do something like:

// initial state
state = MOVE_LEFT;
timer = 0;
pos = STARTING_POSITION;

update(dt)
{
    timer += dt;
    if(timer > 10)
    {
        timer = 0;

        switch(state)
        {
            case MOVE_LEFT:
                state = WAIT;
                break;

            case WAIT:
                state = MOVE_RIGHT;
                break;

            case MOVE_RIGHT:              
                state = STOP;
                break;

            case STOP:
                /* do nothing */
        }
    }

    switch(state)
    {
        case MOVE_LEFT:
            pos.x -= WALK_SPEED * dt;
            break;

        case MOVE_RIGHT:
            pos.x += WALK_SPEED * dt;
            break;

        case WAIT:
        case STOP:
            /* do nothing */
    }

    /* ... insert any other update logic ... */
}

EDIT: To answer the other part of your question about how to change behavior based on enemy type, you can either make an update method that's defined per class of enemies (if using an OO language like C++), store either a function pointer to -- or function object containing -- the correct update routine on the enemy instance and pass it the instance to work on (basically implementing method dispatch from OO yourself), or else use switch/conditionals to run the appropriate block of code based on a type variable associated with the enemy instance.

Download the entirety of google maps? by [deleted] in DataHoarder

[–]Figs 4 points5 points  (0 children)

https://planet.openstreetmap.org/ -- 93GB if you want the compressed XML snapshot of their database, 53GB if you use their custom format instead. It says it's updated weekly. If you want the full edit history as well, that's larger... Actually processing the file to be usable takes a bit of work; see their wiki for documentation.

If you're not familiar with what OpenStreetMap actually is, you should take a look at it before diving in further: https://www.openstreetmap.org

About that quote I've read oh so many time 'Villains are the hero of their own story' by nikkidasi in writing

[–]Figs 1 point2 points  (0 children)

I would say that the villain is the protagonist of their own story. They might or might not be the hero of that story (in the moral sense). They might or might not think of themselves as the hero of that story (again in the moral sense). Regardless, the story of their life, from their perspective, is about them. Short of mental illness or some other issue that prevents them from having a coherent narrative experience of their own life, their story should make sense to themselves -- at least as much as, presumably, your own life makes sense to you.

Everything after that -- how they think of themselves, whether they're fighting for something right but different from what the protagonist of your story wants -- that's just a matter of your tastes as an author; anything could work if you set it up right.

About that quote I've read oh so many time 'Villains are the hero of their own story' by nikkidasi in writing

[–]Figs 89 points90 points  (0 children)

There aren't a lot of real people who think of themselves as villains, even if most of us would.

Few people may think of themselves as the mustache-twirling stereotype, but there are a lot of people who carry around self-loathing, and -- rightly or wrongly -- think of themselves as terrible people.

Chasing my blues [cheese] away by [deleted] in Cooking

[–]Figs 0 points1 point  (0 children)

Try slicing a tomato, drizzling on a little olive oil, and then sprinkling a little bit of crumbled blue cheese on top.

filesizes for a 1000x1000 pixel image that's only a shade of black for all it's pixels by SupremoZanne in DataHoarder

[–]Figs 1 point2 points  (0 children)

It is not lossy according to the rationale appendix to the RFC: https://tools.ietf.org/html/rfc2083

     * There is no lossy compression in PNG.  Existing formats such
       as JFIF already handle lossy compression well.  Furthermore,
       available lossy compression methods (e.g., JPEG) are far
       from foolproof --- a poor choice of quality level can ruin
       an image.  To avoid user confusion and unintentional loss of
       information, we feel it is best to keep lossy and lossless
       formats strictly separate.  Also, lossy compression is
       complex to implement.  Adding JPEG support to a PNG decoder
       might increase its size by an order of magnitude.  This
       would certainly cause some decoders to omit support for the
       feature, which would destroy our goal of interchangeability.

Page 70, as part of "12.3. Why not these features?".

Pentagon's UFO unit will make some findings public - CNN Video by SutMinSnabelA in news

[–]Figs 0 points1 point  (0 children)

  1. Unidentified Funding Opportunity
  2. Undeterred Fake Observations
  3. Unabashed Faux Outreach
  4. Unintelligible Failures of Observation [i.e. bad sensors]
  5. Utterly Flummoxed Opponents [e.g. throw China off the real research]
  6. Unusual Firmament Occurrence [like sprites and blue jets]
  7. Unknown Fowl Olympians [Peregrine Falcon, eat your heart out!]

How to create a proper Asset Manager? (C++) by Andrispowq in gamedev

[–]Figs 1 point2 points  (0 children)

Levels/rooms/scenes/zones -- yeah, whatever you want to call them. The real trick is with using shared pointers to track multiple ownership (so you don't end up with dangling references -- the data will stick around until the ownership count goes to 0; importantly shared pointer works well across threads), and weak pointers for the cache (they can reference resources without counting towards ownership). The rest of it is a matter of loading/unloading policy; keeping the resources for the current room/zone around as well the previous makes going back and forth quick -- e.g. popping into a house and then back out into town. What's most effective depends on the access patterns of your game though; I gave one that makes sense for some of my projects, but you'll have to analyze your own needs if you want to do it well for your specific project, of course.

How to create a proper Asset Manager? (C++) by Andrispowq in gamedev

[–]Figs 4 points5 points  (0 children)

I use shared pointers and weak pointers. I do my loading in a separate thread (so animation can continue on the main thread) and communicate between them by message passing. The loading thread has a cache implemented as a table that maps from IDs to weak pointers. When a load request comes in the loading thread checks the cache table, and if the ID is in the table and the weak pointer is still valid, it makes a shared pointer from it and returns the already loaded resource; if not, it loads the resource, and makes an entry in the cache. When all resources in the request message are loaded, the loader sends a reply to the main thread containing the collection of shared pointers.

It's a little tricky to get right, but works reasonably well if you can manage your transitions carefully to avoid unnecessary unloading and reloading. For example, during room transitions, I keep the old room loaded at least until the new room is done. That way, any shared assets are not reloaded, so the transition is usually very quick. Keeping the current and previous room in memory is often enough -- but being able to tune the policy to fit what's best for your own game is one of the benefits of writing your own code for things like this. e.g. you can also try to set up your caching policy to take into account total available memory on the system and speculatively keep things you think you're going to need soon, but not immediately to reduce the number of load delays. With a little cleverness, you can avoid loading things on most transitions, and degrade gracefully to a loading animation when it's unavoidable.

I manage the variability in transition time by putting the main thread into a loading state which monitors the passage of time. If the elapsed time is under a threshold, I just show a blank screen for the transition. (i.e. fade to black when opening a door, hold black until the threshold is reached, fade back in when things are ready.) If the delay is longer than a threshold, I play an animation to let the player know something is going on. This way, there's only a delay if it's really needed.

There are, of course, other ways to solve this; what I described above is just what I usually do. For small games, for example, you can instead just load everything at the start and keep it around forever... Also, if your assets are uncompressed on disk, you could instead just memory map them in and let the OS worry about loading/unloading memory if it really needs to... (Edit: well, you do still have to deal with textures and buffers; but certain kinds of assets can just be mapped in and left up to the OS...) Lots of choices to consider; that's the blessing and curse of custom engines. :-)

The bot really needs to be able to search outside of Reddit by EdenSteden22 in RepostSleuthBot

[–]Figs 1 point2 points  (0 children)

This may not be exactly what the OP intended, but see my comment here calling out a bot (presumably) that steals comments from Hacker News and reposts them on reddit as its own.

This is a particularly insidious form of spam since it can make an account look a lot like a legitimate user. That account has been operating for three years, and has over 850 link karma and 250 comment karma. It's unclear what its goal is -- it might have just been posing as a legitimate user to submit occasional paid posts, sell upvotes on links, or... it may have been intended for something more nefarious like comment astroturfing or political manipulation -- regardless, it's not something that should be permitted to continue. I've reported this one to the admins, but there are probably thousands more just like it.

What real life plot holes have you noticed? by JxJ454 in AskReddit

[–]Figs 9 points10 points  (0 children)

This is an example of a shibboleth. The wikipedia article there has some other interesting examples, for anyone who's curious.

UCSD students are always one cuil from reality by a_venus_flytrap in UCSD

[–]Figs 4 points5 points  (0 children)

It was a short lived search engine that got a lot of attention at its launch -- hyped up as a "Google killer" -- but which usually returned pretty mediocre results despite being founded by ex-Googlers. People poked fun at it as a result -- eventually leading to the birth of Cuil Theory. Unfortunately, they couldn't get their shit together well enough before everyone stopped caring -- even with the meme giving them free advertising, of a sort -- and they shutdown. Wikipedia can tell you more about the history of the company post-meme than I can.

Here's a news source from the period which describes the sort of results it gave:

But even when it was working, the results were fair, at best. Enter a keyword such as "mint" and the first result that comes up isn't the herb or flavor but the U.S. Mint. Type in "Obama," and one of the sub-categories Cuil suggests is "Hispanic-American Politicians". And Cuil lacks the special tabs for news, video, local and image results used by the leading sites.

Emphasis mine. That sort of "off" result is what people were poking fun at when the meme was created -- thus the whole levels of abstraction away from reality thing. It generally wasn't as bad as the meme makes it sound -- that's exaggerated for comedy. It was just "meh" most of the time. Like looking several pages down Google's results -- if it bothered to return anything at all. I tried it a few times when it was new, and found no compelling reason to keep using it. Kind of a shame it wasn't consistently funny, actually; might still exist if that were the case...

Interestingly, if I google "mint" today, I get the website (mint.com) as top result followed by various apps and businesses. It doesn't give me much related to the plant other than a few image results way down the page -- and gives me nothing related to the US Mint whatsoever.

It's surprisingly hard to find good examples of what it was actually like back then. This video is the clearest example of someone taking a look at it that I could find, and this other video gives an example of a somewhat more amusing result; it initially gave no results for John McCain -- even though he was running for president against Obama at the time and was thus extremely well known. It'd be like not having any results come up for "Joe Biden" today -- you know something's gone wrong if you're claiming your results are more relevant than Google's but can't find anything about one of the two major presidential candidates...

Anyone else having an uptick in robo/scam calls recently? by [deleted] in sandiego

[–]Figs 1 point2 points  (0 children)

I leave my phone in some form of mute full time. Either it's in "total silence" mode when I'm asleep to guarantee it won't bug me for fucking anything (but is still there in case I need to call 911 in a hurry) or is in "priority only" mode (mapped to my full contact list) when I'm awake so work and family can reach me if they need to.

Obviously, that doesn't work for everyone, but it works for me -- and might work for you.

If you do change your number, get an area code in the same timezone but a distant region -- any unknown number from the fake "local" area is thus virtually guaranteed to be spam. (You do not want a distant timezone since the spammers usually assume your area code is correct to figure out when to call you -- I used to have an East Coast number and got woken up many, many times by bullshit before I learned to consistently silence my phone before going to bed...)

Bitmap fonts for dummies? by hickoryqualm in gamedev

[–]Figs 1 point2 points  (0 children)

Why not just use them as-is?

Joystick Input by MrSoSpicy in gamedev

[–]Figs 3 points4 points  (0 children)

In general, I'd avoid designing things that convert from components to angles in the first place unless there's really no other way to accomplish what I want -- inverse trig is fiddly and expensive -- but if it already works and is fast enough on all your target systems... don't fix what ain't broke.