Jump to content
  • Advertisement

jolyqr

Member
  • Content Count

    285
  • Joined

  • Last visited

Community Reputation

100 Neutral

About jolyqr

  • Rank
    Member
  1. jolyqr

    Strategic games AI

    yes, i' like to de something similar to the sims... thanks the tips. Joly
  2. Hello there !! I'm planning to make a video game like Sim City. I'd like the characters to act and react according to the player actions. I don't know how starting building the AI. Do you have any advice for making such AI ? Cheers Joly
  3. jolyqr

    interview assignement

    what does it mean returning "@-1@" for "nf_dstr_init" function?
  4. jolyqr

    interview assignement

    Quote:Original post by yaustar Tip #3: Use unit checks to test your code. my problem is i have difficulties to understand some functions description... how would you use unit testing here?
  5. jolyqr

    interview assignement

    there is what I've done. i find this assignment pretty difficult... int nf_dstr_init(nf_dstr *d, nf_arena *a); { d->a=NULL; d->buf=NULL; d->len=sizeof(d); d->sz= d->st=0; return ; } void nf_dstr_zero(nf_dstr *d, nf_arena *a) { d->st=1; } void nf_dstr_destroy(nf_dstr *d) { free(sizeof(d)); } they're lots of things i don't get. i don't get what are the purposes of : -nf_arena -size_t (where is its implementation?)
  6. jolyqr

    interview assignement

    Of course, I'm not asking you to do it for me. But I will post what I've done so far and I would like you to give me tips and advices. Cheers
  7. jolyqr

    interview assignement

    interview-arena.h file: /* -*-c-*- * * Memory allocation abstraction * */ #ifndef ARENA_H #define ARENA_H #ifdef __cplusplus extern "C" { #endif /*----- Header files ------------------------------------------------------*/ #include <stddef.h> /*----- Data structures ---------------------------------------------------*/ typedef struct nf_arena { const struct nf_arena_ops *ops; } nf_arena; /* aalloc, afree and arealloc work analogously to malloc, free and realloc */ typedef struct nf_arena_ops { void *(*aalloc)(nf_arena *a, size_t sz); void (*afree)(nf_arena *a, void *p); void *(*arealloc)(nf_arena *a, void *p, size_t sz); void (*adestroy)(nf_arena *a); } nf_arena_ops; #ifndef DISABLE_NONNF typedef nf_arena arena; typedef nf_arena_ops arena_ops; #endif /*----- Standard arena: uses @malloc@/@free@ ------------------------------*/ extern nf_arena nf_arena_std; /*----- Handy macros ------------------------------------------------------*/ #define aALLOC(a, sz) ((a)->ops->aalloc((a), (sz))) #define aFREE(a, p) ((a)->ops->afree((a), (p))) #define aREALLOC(a, p, sz) ((a)->ops->arealloc((a), (p), (sz))) #define aNEW(a, p) ((p)= (a)->ops->aalloc((a), sizeof(*p))) /* All of the above evaluate their first argument multiple times. */ /*----- That's all, folks -------------------------------------------------*/ #ifdef __cplusplus } #endif #endif [Edited by - jolyqr on October 23, 2007 3:43:17 AM]
  8. jolyqr

    interview assignement

    interview-dstr.h file: /* -*-c-*- * * Dynamic string construction interface * */ #ifndef DSTR_H #define DSTR_H #ifdef __cplusplus extern "C" { #endif /*----- Header files ------------------------------------------------------*/ #include <stdio.h> #include <stdarg.h> #ifndef ARENA_H # include "arena.h" #endif /*----- Data structures ---------------------------------------------------*/ /* Use these fields directly for read access to the dstr. * Always ensure that 0 <= len <= sz. */ typedef struct nf_dstr { nf_arena *a; char *buf; /* contains the current value of the string */ size_t len; /* number of bytes used (not including terminating null) */ size_t sz; /* size of allocation currently in use */ int st; /* current error status */ } nf_dstr; #ifndef DISABLE_NONNF typedef nf_dstr dstr; #endif /*----- Functions provided ------------------------------------------------*/ /* --- @nf_dstr_init@ --- * * * Arguments: @nf_dstr *d@ = pointer to dynamic string * @nf_arena *a@ = pointer to arena to use * * Returns: Zero on success, or @-1@ on error. * * Use: Initializes a string accumulator. */ int nf_dstr_init(nf_dstr *d, nf_arena *a); /* --- @nf_dstr_zero@ --- * * * Arguments: @nf_dstr *d@ = pointer to dynamic string * @nf_arena *a@ = pointer to arena to use * * Returns: -- * * Use: Initializes a string accumulator to a valid state, * but does not preallocate any memory. This cannot fail, * and forgetting about the dstr while it is in this state * does not leak any memory. */ void nf_dstr_zero(nf_dstr *d, nf_arena *a); /* --- @nf_dstr_destroy@ --- * * * Arguments: @nf_dstr *d@ = pointer to dynamic string * * Returns: --- * * Use: Destroys a dynamic string. * Leaves the string in the same state as @nf_dstr_zero@. */ void nf_dstr_destroy(nf_dstr *d); /* --- @nf_dstr_check@ --- * * * Arguments: @const nf_dstr *d@ = pointer to dynamic string * * Returns: Zero on success, or @-1@ on error. * * Use: Returns @Status_OK@ if the string is working, or a status * code which explains what'd wrong with it. */ int nf_dstr_check(const nf_dstr *d); /* --- @nf_dstr_ensure@ --- * * * Arguments: @nf_dstr *d@ = pointer to dynamic string * @size_t sz@ = amount of free data needed * * Returns: Zero on success, or @-1@ on error. * * Use: Ensures that there'd enough free space in the string for * something to be added. */ int nf_dstr_ensure(nf_dstr *d, size_t sz); /* --- @nf_dstr_reset@ --- * * * Arguments: @nf_dstr *d@ = pointer to dynamic string * * Returns: --- * * Use: Resets a string. The string becomes empty, and further * additions appear at the beginning. */ void nf_dstr_reset(nf_dstr *d); /* --- @nf_dstr_putc@ --- * * * Arguments: @nf_dstr *d@ = pointer to dynamic string * @int ch@ = character to add * * Returns: Zero on success, or @-1@ on error. * * Use: Adds a character to a dynamic string. */ int nf_dstr_putc(nf_dstr *d, int ch); /* --- @nf_dstr_putz@ --- * * * Arguments: @nf_dstr *d@ = pointer to dynamic string * * Returns: Zero on success, or @-1@ on error. * * Use: Puts a null terminator on the end of a dynamic string. The * null terminator doesn't count as part of the string, however, * and it'll be overwritten with the next @put@ call. */ int nf_dstr_putz(nf_dstr *d); /* --- @nf_dstr_puts@ --- * * * Arguments: @nf_dstr *d@ = pointer to dynamic string * @const char *p@ = pointer to a string to add * * Returns: Zero on success, or @-1@ on error. * * Use: Adds a string to a dynamic string. A null terminator is also * attached. */ int nf_dstr_puts(nf_dstr *d, const char *p); /* --- @nf_dstr_putm@ --- * * * Arguments: @nf_dstr *d@ = pointer to dynamic string * @const void *p@ = pointer to a block to add * @size_t sz@ = size of the block. * * Returns: Zero on success, or @-1@ on error. * * Use: Adds an arbitrary binary block to a dynamic string. */ int nf_dstr_putm(nf_dstr *d, const void *p, size_t sz); /* --- @nf_dstr_putd@ --- * * * Arguments: @nf_dstr *d@ = pointer to dynamic string * @const nf_dstr *dd@ = pointer to a string to add * * Returns: Zero on success, or @-1@ on error. * * Use: Adds a string to a dynamic string. A null terminator is also * attached. */ int nf_dstr_putd(nf_dstr *d, const nf_dstr *dd); /* --- @nf_dstr_puthex@ --- * * * Arguments: @nf_dstr *d@ = pointer to dynamic string * @const void *p@ = pointer to data * @size_t sz@ = size of the data * * Returns: Zero on success, or @-1@ on error. * * Use: Writes a hex representation of a binary block to a string. */ int nf_dstr_puthex(nf_dstr *d, const void *p, size_t sz); /* --- @nf_dstr_putline@ --- * * * Arguments: @nf_dstr *d@ = pointer to a dynamic string block * @FILE *fp@ = a stream to read from * * Returns: The number of characters read into the buffer, or @EOF@ if * end-of-file was reached before any characters were read. * * Use: Appends the next line from the given input stream to the * string. The trailing newline is stripped; a trailing null * byte is appended, as for @dstr_putz@. */ /*----- That's all, folks -------------------------------------------------*/ #ifdef __cplusplus } #endif #endif [Edited by - jolyqr on October 23, 2007 3:42:16 AM]
  9. Well, I've been recently given a mini c project for a work interview. This is about c programing, strings manipulation exactly. There are the instructions: "Please find attached 2 C header files, interview-dstr.h and interview-arena.h. The task is to provide an implementation, interview-dstr.c, of the functions declared in interview-dstr.h (There is no need to write an implementation of interview-arena.h, you may assume that one already exists.) You may use any C documentation or other online resources to help you with the implementation. You should assume that the implementation is to be used in production quality software and that it must conform exactly to the comments in interview-dstr.h. If you find that any comment for a dstr function does not completely define the functions behaviour, you should decide how to make the function behave and improve the documentation in interview-dstr.h."
  10. jolyqr

    Mobile phone programming

    You're right, I can send photos via the bluetooth, but I haven't tryed to send any jar file. I will...
  11. jolyqr

    Mobile phone programming

    I'm using a Vodafone Sharp GX17...
  12. Hello I have started recently developing some mobile phone applications. I'm using the sun wireless toolkit. I was wondering how do I test my applications on real devices. Besides I've got some difficulties for finding web sites providing open source program samples. Cheers !!
  13. Quote:Original post by Anonymous Poster Quote:Original post by Son of Cain I can't comment on AgentFX or Aviatrix3D, but the JMonkeyEngine has made a lot of progress over the years, and its community is awesome! Xith3D is also a very good SceneGraph API, but JME seems to be much more promising to me. Hi jolyqr ! I'm one of Xith3D devs, and I had to mention here that a lot is going on on Xith3D these weeks, so beware of old informations. I use Xith3D for my game (of coruse) and I find the community effort has massively increased since last year. Go have a look : http://www.xith.org/ (Uh oh, didn't check the dates, am I necromancing ?) Good to see you there, because i've got some questions for you. I did try to test xith3D examples on my computer, unfortunately none of them did run. Do you know why? I have tried several times to register in xith3D forum, i have never been accepted so far. why?
  14. Thanks alot. Do you know the advantages and trade off of the following API, except the fact that some aren't entirely free ? -Xith3d -jMonkeyEngine -AgentFX -Aviatrix3D
  15. Quote:Original post by lightbringer Well, you could try to use LWJGL directly. But unless you really enjoy getting your hands dirty with low level code, and have a good grasp of the fundamentals of 3d programming, you are going to be bored and/or stumped soon. If designing a scene graph from scratch does not appeal to you, then yes Xith3d or jME is probably the way to go - they do a lot of the dirty work for you. There is at least one more open-source API, called Aviatrix3D, but on their site they claim that is is specifically not targeted at games. There's also a commercial project called AgentFX. It is free for non-commercial use, but they do not specify a concrete price for licensing the engine for commercial use. thanks !!
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!