• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Question] Problem building the Openpok?

Bonnox

Time (wasting) Lord
47
Posts
8
Years
  • Problem building the Openpoké

    Hello everyody.

    Today I would like to ask someone more expert than me about a merely programming problem.

    Some time ago I discovered a program called Openpoké (link), which is a GBA game which aim to recreate the pokemon game engine. So far, so good. Then I wanted to compile it just to have some practice and mess with the code, just for fun, or maybe to try to see if this method could have replaced the hack method. (hehe...)
    But that's when problem occurs.

    After some time the compilation process has begun, the executable gives an error:
    "No rule to make target `pokepics.a', needed by `openpoke.elf'. Stop."

    I know something about C, but not so deeply to go and edit a complex makefile!
    So I googled rapidly and found that this error mean that the file is missing. And so it was. I therefore poked around the source files and thought that maybe it was a mispelling, and the correct name was "pokepics.s"; searched for "pokepics", but nothing was found.

    So I would like to ask you whether you succed in building this awesome thing, and how you solved any problem you faced in the process.

    See you soon :)
     
    1,403
    Posts
    10
    Years
    • Seen Apr 29, 2024
    (If you're running linux like me you need to change gfx_baserules to reference "grit" instead of "grit.exe")

    Create a makefile in "pokemon" that builds "pokepics.a", (I based mine on the one in "itemicons").
    Build the gfxmake .a files ("make -f gfxmake").
    Use "Kopie van pokedex.c" instead of "pokedex.c" (i.e. rename it); I think you could also just rename the missing symbols to what they're called in the copy.
    Delete the references to party_41{2,3,4}Tiles in "partyicons.c".
    Delete the DEF(41{2,3,4}) lines from "pokedata_images.txt".

    Success!

    Just a hint, I just did a lot of "grep -R" to find what/where I needed to make changes.
     
    Last edited:

    Bonnox

    Time (wasting) Lord
    47
    Posts
    8
    Years
  • forst of all thanks for yhe reply, sir! ^^

    here I have dissected your post, for the sake of clarity:
    (If you're running linux like me you need to change gfx_baserules to reference "grit" instead of "grit.exe")

    I do have a lunix installation, but with this kind of complicated stuff i'd rather prefer to go with windows.

    Delete the references to party_41{2,3,4}Tiles in "partyicons.c".
    I think to be able to do that :)
    but that strange writing was your abreviation, wasn't it? I mean, there are 4 lines that need to be deleted, the 41 to the 44, right?
    Delete the DEF(41{2,3,4}) lines from "pokedata_images.txt".
    same as above.

    Create a makefile in "pokemon" that builds "pokepics.a", (I based mine on the one in "itemicons").
    I'm really sorry for bothering you, but I have no clue on how to do that :3c

    Build the gfxmake .a files ("make -f gfxmake").
    There is a batch (is like a .sh script) in the root of the project wich makes the same exact thing, is therefore this point done? And is this the only thing to do for building everything, at the end?

    Use "Kopie van pokedex.c" instead of "pokedex.c" (i.e. rename it);
    I renamed "pokedex.c" to "pokedex.c.old" and removed the "kopie van" (copy of? ahah) in the other file.

    I think you could also just rename the missing symbols to what they're called in the copy.
    sorry, but I don't undestand this point. I have heard that symbols are something that is related to programming, but that's all.


    sooo.. are you good at building complicated project? how did you discovered that? How was I supposed to discover that, if there is no documentation? Have you figured out how the sources work toghether? Until now, I have understood the cries (lol), the scripts and some other nice ASM data things. In particular, the scripts are really cuddly! :3 eheh (ok i'm mad)

    I'm sorry again If I bothered you :)
     
    1,403
    Posts
    10
    Years
    • Seen Apr 29, 2024
    but that strange writing was your abreviation, wasn't it? I mean, there are 4 lines that need to be deleted, the 41 to the 44, right?
    Yes, sorry, I meant party_412, party_413, party_414. (If you're curious I borrowed the notation from shell globbing in bash)

    I'm really sorry for bothering you, but I have no clue on how to do that :3c
    I copied makefile from itemicons into pokemon and changed "TARGET := ../itemicons.a" to "TARGET := ../pokepics.a".

    There is a batch (is like a .sh script) in the root of the project wich makes the same exact thing, is therefore this point done? And is this the only thing to do for building everything, at the end?
    Ah yes, you're right, makearcs.bat does exactly "make -f gfxmake" so you can call that instead. If you've done all the previous steps then this should build all the ".a" files.

    sorry, but I don't undestand this point. I have heard that symbols are something that is related to programming, but that's all.
    So if you use the original "pokedex.c" file the errors that come back (from your linker) are that you have "undefined symbols"; basically "pokedex.c" uses variables that don't exist. But it looks like you could just change a few names (e.g. dexlist_gsPal to dexlistPal) and be able to use the original file; you might want to try that because there are some other differences between the two files (I'm not sure if Windows has an equivalent, but I can see the changes with "diff pokedex.c pokedex.c.old").

    sooo.. are you good at building complicated project? how did you discovered that? How was I supposed to discover that, if there is no documentation? Have you figured out how the sources work toghether? Until now, I have understood the cries (lol), the scripts and some other nice ASM data things. In particular, the scripts are really cuddly! :3 eheh (ok i'm mad)

    I'm sorry again If I bothered you :)
    I've built a few projects before, and I occasionally write Makefiles for my own stuff, so I'm used to seeing those kinds of errors. As I said before, I'd mostly just search all the files (which is what "grep -r" does), for something that sounds like it might be related to the current error, the only trick is having written enough C that you've seen all the compile errors GCC will give you :)

    I haven't tried to understand the source at all, only build it, but if you have questions feel free to ask them here and I'll see what I can do to help.
     

    Bonnox

    Time (wasting) Lord
    47
    Posts
    8
    Years
  • Yes, sorry, I meant party_412, party_413, party_414. (If you're curious I borrowed the notation from shell globbing in bash)

    don't worry :)

    I copied makefile from itemicons into pokemon and changed "TARGET := ../itemicons.a" to "TARGET := ../pokepics.a".
    cool trick!

    the only trick is having written enough C that you've seen all the compile errors GCC will give you :)

    ah. that's scary :)

    I haven't tried to understand the source at all, only build it, but if you have questions feel free to ask them here and I'll see what I can do to help.

    soo, I'm sorry to take advantage of your free time and kindness (you should think I'm a noob, isn't it?)
    here are the steps I did:

    - correct everything like the previous posts
    - return to project root folder
    - launch the batch that "compiles" the graphics
    - launch make

    after A LOT of time and warnings, it gave me an error:

    data/partyicons.c:492:2: error: 'party_041Tiles' undeclared here (not in a function)
    party_041Tiles,
    ^
    data/partyicons.c:493:2: error: 'party_042Tiles' undeclared here (not in a function)
    party_042Tiles,
    ^
    data/partyicons.c:494:2: error: 'party_043Tiles' undeclared here (not in a function)
    party_043Tiles,
    ^
    data/partyicons.c:495:2: error: 'party_044Tiles' undeclared here (not in a function)
    party_044Tiles,
    ^
    make: *** [data/partyicons.o] Error 1

    so I went to that file and blindly deleted the lines. I thought that with these correction it would have finalli compiled, but I was wrong.
    Infact, at the next attempt, it gave a more terrifying error:

    DNDEBUG -c vwf.iwram.c -o vwf.iwram.o
    make: *** No rule to make target `specialmon.a', needed by `openpoke.elf'. Stop.

    uff... special pokemon! who cares? I am ready to delete them if they prevent me from compiling! In the folder /pokemon/special, THERE IS a (huge) makefile, and it says that the target is "/../../specialmon.a", which I think should be fine, but it isn't.
    therefore, unusefully thinking to be smarter than the compiler/author, I removed "specialmon.a" from the main makefile, obviously without knownig what the repercussions will be {XD}

    other errors, which led me to remove others undefined references to unknown a - z, eggs and a lot of useless things.

    during the process, by accident, I found this:
    Spoiler:


    this is just... irritating. seems like the author forgot to update the copy-paste work ^^". Should I rename correctly?

    - after some time, I just gave up. every little attempt to sole something, breaks many other things. why the hell does someone share a so messy source? and this isn't the only case. I remember many sources wich I downloaded in the past, that weren't able to compile. I think this approach is extremely anti-newbie. even better, this discourages the user!


    but, ehy... now I'm beginning to think that maybe the error was a misconfiguration of the graphics creator, and not the source?
    infact the "a" files are created by the graphic converter... :mumble:

    EDIT: ehy, I think to have found the culpript!
    basically, the gfxmake doesn't scan items in subdirectories, therefore the specialmons can't be assembled!! :O
    soooo. how to fix that?
    (sorry again)
     
    Last edited:
    1,403
    Posts
    10
    Years
    • Seen Apr 29, 2024
    Hmm... I'm not sure why you're getting different errors to me...

    I did a bit of searching on github, and found https://github.com/JaceCearK1/ReOpenPoke I had to fiddle with some of the names to get it to compile (case-sensitivity issues), but I think it would work out of the box for you.

    EDIT: One option would be to run "make" inside the "pokemon/specialmons" directory (e.g. "cd pokemon/specialmons && make").
     

    Bonnox

    Time (wasting) Lord
    47
    Posts
    8
    Years
  • Hmm... I'm not sure why you're getting different errors to me...

    I [...]

    waaaa! I REALLY, REALLY, REALLY thank you for what you have done for assisting a newbie like I am! ^_^ IT NOW WORKS!! :D
    I have never built such big projects, nor used a makefile!
    hmmm, I think I should "watch" a lot of people now on github now... (starting by shinyquagsire; and are you mcgriffin on github?)

    I notice with joy that that guy fixed an important issue, the one wich didn't move reactively your character when changing direction. Nevertheless there is a new bug in the OAMs which i think could be possibly be related to (un)compression things, but since the whole things now compiles (and you can't understand my joy), I think I could try to correct it and enhance the game, if "hacking" it is not enough! ^^ (pfff.... that's like a stupid kid's dream)

    so, if you would like to say some ending sentences, I will be happy to listen at you!
    your mastery has impressed me, I think we should stay in contact ! (if I passed more time on the forum)

    thank you again andgoodbye{:3}
     
    Last edited:
    1,403
    Posts
    10
    Years
    • Seen Apr 29, 2024
    Glad to hear it's working :) I'm mrgriffin on github, but there's nothing very interesting up there.

    Good luck with enhancing the game, I'd be very interested to see what you do with it!

    Feel free to contact me, I don't post here very often, but I log in almost every day.
     

    Bonnox

    Time (wasting) Lord
    47
    Posts
    8
    Years
  • Glad to hear it's working :)

    hey, may I ask some other things? pleease! obviously not only to you, but everyone! In fact I think that this piece of software could be the equivalent of the open source office suite, but the counterpart for games! Only for its premises (blame google translate if this term makes no sense to you) it is worth the attention of the community, but instead almost no one took care of it!

    If you are planning to make an hack, you could collaborate in improving it! (read "you" as impersonal pronoun, like "man" in german)
    therefore, instead using this project only as a cavy (again blame google, this really seems a false friend) to be tortured with C experiments, could prove its real utility being used as a "stable" rombase for our new "hacks" ! (and since I hate fire red, and can't understand its disassembly completely ahah)

    to be honest, this fairy and hope-full introduction was done to take your attention because I have a problem (strange, eh? ) :c sorry. (and because is pleasant to talk to you)
    I write here because on github I'm unable to communicate with the author, while here there are a lot of experienced people!

    the problem now is not on making the source compile, but since is related to a problem, maybe posting globally instead of privately is a better choice.
    I don't know what you get after the build, but I have quite harrassing problems, but exentially can be reduced to 2 categories:
    1) trainerbattle with dani makes the game freeze.
    2) overworlds are glitchy, like missingnos were injected in the game.

    I've not investigated on the first too much, I just think there are some errors in the data, maybe?

    talking about the second, after some research, I found what could be the cause:
    there seem to be an error in the configuration of the graphic maker. infact, opening "ow.a" and "trainerspic.a" with GBA graphics editor (a really cool program for windows), the graphics data look really strange. the shape and the colour are the same, but effective pixels are not. to be more clear, this is an example

    Spoiler:


    what could be the cause? grit's, makefile's, png's or mine fault?

    the ows are also worse, you basically can't even recognise the shape of a person (has organized crime tortured them? ahah very sad pun)

    with the others "a" files is all fine.

    does it helps saying that I had to rename the folder "trainerwhatever" to "trainers" because the make.exe said that the folder was not found? (the same of above, you annot download a source and hope that it would work at the first attempt -.-" fortunately this time was REALLY simpler make it work :) )or is normal?

    also, coul you please direct me towards some good makefile tutorial? I woud appreciate it and be grateful (as if you have not did enough for me ahah)

    good night ;) (yeah, finally an european member, with more or less my same timezone ahah)

    and... with a bit of blushing... is my english good? maybe I own a confined vocabulary?
     
    Last edited:
    1,403
    Posts
    10
    Years
    • Seen Apr 29, 2024
    If you are planning to make an hack, you could collaborate in improving it! (read "you" as impersonal pronoun, like "man" in german)
    therefore, instead using this project only as a cavy (again blame google, this really seems a false friend) to be tortured with C experiments, could prove its real utility being used as a "stable" rombase for our new "hacks" ! (and since I hate fire red, and can't understand its disassembly completely ahah)
    (I think you mean guinea pig instead of cavy, I've never heard anyone say cavy!)

    I think you're saying that it would be a good idea to collaborate on a Pokémon engine written in C, rather than messing around with assembly (and having to fiddle with pointers etc). That certainly sounds like a worthwhile cause, I'd definitely be interested in improving the AI and battle system.

    the problem now is not on making the source compile, but since is related to a problem, maybe posting globally instead of privately is a better choice.
    I don't know what you get after the build, but I have quite harrassing problems, but exentially can be reduced to 2 categories:
    1) trainerbattle with dani makes the game freeze.
    2) overworlds are glitchy, like missingnos were injected in the game.

    I've not investigated on the first too much, I just think there are some errors in the data, maybe?

    talking about the second, after some research, I found what could be the cause:
    there seem to be an error in the configuration of the graphic maker. infact, opening "ow.a" and "trainerspic.a" with GBA graphics editor (a really cool program for windows), the graphics data look really strange. the shape and the colour are the same, but effective pixels are not. to be more clear, this is an example

    Spoiler:


    what could be the cause? grit's, makefile's, png's or mine fault?

    I'm not sure, but your sprite it looks as if all the pixel are twice as far apart as they should be and not all the colors are there, so I would assume that you're either encoding or decoding it incorrectly, probably it's saved with an 8-bit palette but loaded with a 4-bit one, or something like that?

    Maybe I'll look into the battle later.

    also, coul you please direct me towards some good makefile tutorial? I woud appreciate it and be grateful (as if you have not did enough for me ahah)
    I'd just read the GNU make manual, but that might be too dense if you've not worked with make before?

    good night ;) (yeah, finally an european member, with more or less my same timezone ahah)

    and... with a bit of blushing... is my english good? maybe I own a confined vocabulary?
    Good morning!

    I think your English is fine, I understand what you're trying to say (I hope!) :)
     

    Bonnox

    Time (wasting) Lord
    47
    Posts
    8
    Years
  • (I think you mean guinea pig instead of cavy, I've never heard anyone say cavy!)
    I meant the small mice used in labs for testings :3

    I think you're saying that it would be a good idea to collaborate on a Pokémon engine written in C, rather than messing around with assembly (and having to fiddle with pointers etc). That certainly sounds like a worthwhile cause, I'd definitely be interested in improving the AI and battle system.
    yeah, exactly. you got the point. I instead will try to simplify the code to make it more understandable to non C pros (uhm... guess it's impossible)
    and add cool features of questionable usefullnes according to people like linux shell purists :^

    I'm not sure, but your sprite it looks as if all the pixel are twice as far apart as they should be and not all the colors are there, so I would assume that you're either encoding or decoding it incorrectly, probably it's saved with an 8-bit palette but loaded with a 4-bit one, or something like that?

    news: I don't know what happened, but trainers now work correctly! well, with GBA graphics editor is still not something correct, but magically in the game I managed to dislay the trainer card of both dani and danny (I could get used to those names) correctly.

    NOW, the hard things. I think that the problem is in one of either the makefiles. (a makefile which needs a lot of other makefiles... woah that's psychedelic)

    the ow makefiles uses these parameters:
    -fts -fh! -gu16 -p!

    "unfortunately", are very similar, if not identical, to others' one. So one may ask why the ows are not "compiled" correctly. I tried to mess with those parameters, for example with an -ftb instead of -fts. the output is a correct GBA's 4 bit graphics entity, but then the make (or one of its dependencies, maybe the as) complains that an ".s" file is missing.
    I hate this whole process of Compicated Absurd Obscure Syntax (chaos is without h in italian) like "$<, #*.s*.o*.c, (GRIT) @endif <$" and it on only makes me think to be fooled by compilers.
    why not to use a batch (or a powershell) script that says "for every file png do grit with these correct parameters and then compact (concatenate) them into a single file and provide, as a summary, an handy look up table" without .o and other stupid things.

    to summarize the above paragraph: "why the hell doesn't it compile the ows!!!!!" (capitalized)

    let's return quiet.
    let's analyze the code. obvously I understan less than a quarter of the whole makearcs process, but one part in particular I think is important:
    the "$(GRIT)"

    seriously, I've ran out of ideas. I'm REALLY sorry of having annoyed you, and most of all because you did all the job for me (and this topic contains half of your total posts. I feel guilty )

    I'd just read the GNU make manual, but that might be too dense if you've not worked with make before?
    thanks! that's really impressive (massive). Certainly not a thing to be compared to the short chapter of my C book about "larger programs"




    goodnight!
     
    Back
    Top