[/b/] [/d/] [/tu/] [/a/] [/ph/] [/wa/] [/cg/] [/t/] [/p/]

[Burichan] [Foliant] [Futaba] [Greenhell] [Gurochan] [Photon] - [Home] [Manage] [Archive]

[Return]
Posting mode: Reply
Leave these fields empty (spam trap):
Name
Link
Subject
Comment
File
Verification
Password (for post and file deletion)
  • Supported file types are: GIF, JPG, PDF, PNG
  • Maximum file size allowed is 20480 KB.
  • Images greater than 200x200 pixels will be thumbnailed.

File: 1373089750552.jpg -(448363 B, 974x1206) Thumbnail displayed, click image for full size.
448363 No.94154  

I am making a 2D tile based game engine for DOS

Can you help me make the tile system?

http://4ch.mooo.com/gitweb/?p=16.git;a=snapshot;h=d8212065e78a78a5feb0d80f7e54c546833c3d5a;sf=tgz

source code here

you need a DOS environment and Open Watcom to compile it

>> No.94157  
File: 1373093578953.jpg -(39381 B, 643x512) Thumbnail displayed, click image for full size.
39381

>>94154

>for DOS

Why?

>> No.94158  

>>94157
So it can run on most of the computers in the world today

just pop in DOS on the machine and run the game....

and i have many other reasons....

>> No.94159  

>>94158
First, explain your reasons for «....».
Then explain your reasons for using DOS.
You write in C, but instead of using some SDL you use half-dead system libs full of crutches. Just why?

>> No.94160  

>>94159
I just want to make a DOS game!

>> No.94174  

Do you want to suck my dick, motherfucker?

>> No.94184  

>>94154

>tile based game engine for DOS

Why don't just use Allegro?

>source code here

It's not good to return time as double. It's more difficult to compare:

    if( fabs(timeCurrent-timeCheck)<eps )

and less strict than unsigned long(milliseconds). Moreover, it's more expensive.

>> No.94196  
File: 1373137780005.jpg -(231878 B, 1000x1200) Thumbnail displayed, click image for full size.
231878

>>94184
allegro is 32 bit library
and i cannot compile it with just open watcom....

>> No.94203  
File: 1373141905349.jpg -(93001 B, 642x1000) Thumbnail displayed, click image for full size.
93001

>>94196

>allegro is 32 bit library

I barely understand why do you limit yourself and your engine's users to 16bit. Working in only 640K of memory space is horrible. Anyway, good luck. I couldn't help you much

>> No.94213  
File: 1373144768797.png -(357201 B, 1200x1200) Thumbnail displayed, click image for full size.
357201

>>94203
the game will not be restricted to the 640k memory map
wwww

but it gotta be 16 bit so it can honor the 16 bit era of gaming consoles www

>> No.94217  
File: 1373147357492.jpg -(50476 B, 640x480) Thumbnail displayed, click image for full size.
50476

>>94203
I don't think i can finish this game by myself....

It is way too difficult to achieve....

>> No.94221  

>>94217
That's why you shouldn't limit yourself for no reason

>> No.94241  
File: 1373163888347.jpg -(619414 B, 1024x1024) Thumbnail displayed, click image for full size.
619414

>>94221
ok i just need help!

I am a hands on learner
IF there is a working example in the code i can play with it and learn about it and build from it!

I wish someone can add a player position global variable in the class Core

so i can make global switch variables...

>> No.94249  

Fuck DOS.
Fuck Special Olympics.
Use Python and PyGame. It's easier and faster to work with, I guarantee it.

>> No.94251  
File: 1373185722993.png -(502847 B, 700x1036) Thumbnail displayed, click image for full size.
502847

>>94249

>> No.94254  

>>94251
Who is this girl on the picture?

>> No.94256  
File: 1373189688832.jpg -(103865 B, 600x425) Thumbnail displayed, click image for full size.
103865

>>94254
Mary from http://rpgmaker.wikia.com/wiki/Ib

>> No.94305  

Well, you should define some constants, such as:
1) Size of screen (It'll be easier if it'll contain integer number of tiles), maybe 640 x 480
2) Size of tile, maybe 8x8

Then you should have a representation of tiled world in your memory, the simplest variant will be 2d array of bytes.

You should also have a table of tile bitmaps somewhere

When you have it you shall write a procedure that draws the world at specified integer coordinate (this coordinate maps to lower left corner of your screen).
The procedure will cycle for X and Y axes and draw tiles according to bytes (tile ids) from world array.

It's quite simple. Try to load tiles from your resource file (probably .bmp image?) and display it on screen first.

>> No.94321  
File: 1373231602190.jpg -(527296 B, 707x1000) Thumbnail displayed, click image for full size.
527296

>>94305
I just do not know how to translate that into C++ code
wwww

>> No.94327  

>>94321
Ok, what programming languages do you know?

>> No.94328  

>>94321
It means you do not understand C++.
What to do? Fuck it. Use python and pygame. Stop inventing bicycles. Stop fucking around with your brain.

>> No.94329  

>>94327
C and PHP

>> No.94330  

>>94321
Ask questions one by one.
If you understand C, you could write without advanced C++ features such as classes and STL.

>> No.94338  

>>94328
Дурак ты. ОП тоже дурак, но это как бы само собой, а вот ты — действительно дурак. "Не стройте домики из карт, они разваливаются, используйте фанеру и клей!" Пф. При Сталине такого не было.

>> No.94352  

>>94338
При Сталине не было тебя. Не спорю, было лучше

>> No.94357  

>>94338
О, да, я дурак.
Какой же дурак не откажется использовать готовые фреймворки и удобные библиотеки? Я куда больший дурак, чем хуй с горы (в данном случае — из Луизианы), потому что использую удобные инструменты.
Фанера и клей — врапперы и костыли вокруг карточных домиков. Но, блджад, писать на петоне, в отличие от крестов (тем более под говнодос), куда более приятно мне, дураку.
Может, я чего-то не знаю и биться головой об стену — признак умного, талантливого человека?

>> No.94360  
File: 1373336139483.jpg -(1092784 B, 1080x1617) Thumbnail displayed, click image for full size.
1092784

>>94330
my friend made the engine in C++

i must study C++ more

>> No.94365  

>>94360
Differences between C and C++:

Classes.
Class is like a C-structure with embedded functions.
Functions and variables can be private, protected, virtual and public.

  • private: accessible only within class they are defined within and friend classes. You cannot call them from objects.
  • protected: accessible within class they are defined within, friend classes and classes inherited from them. Still not accessible using call from an object.
  • virtual: accessible everywhere, overloadable (class A has function fn(), class B:A (B is children of A) may redefine fn()). May be called from an object.
  • public: accessible everywhere, cannot be overloaded (redefined in children classes).

Templates
Template function is a function, where you don't know the type of some arguments. Example:

template< class MyType > void do_something(int a, MyType b) {...}

Variable b in this example can be of any type (crutches around ``void*`` in C).

new[] and delete[] operators
tl;dr: Use malloc() and free(), keep amount of allocated bytes in memory somewhere.

You know C? Fucking great! Now you also know C++. Shut up and start working.

>> No.94366  
File: 1373361077373.jpg -(1886475 B, 4288x3216) Thumbnail displayed, click image for full size.
1886475

>>94365

あ!

>> No.94367  
File: 1373361763408.jpg -(146623 B, 750x967) Thumbnail displayed, click image for full size.
146623

>>94366
べ!

>> No.94368  
File: 1373361990068.jpg -(211006 B, 850x1275) Thumbnail displayed, click image for full size.
211006

>>94367
wwww

>> No.94379  
File: 1373387138941.jpg -(179548 B, 960x720) Thumbnail displayed, click image for full size.
179548

>>94367
>>94368
I will do things to your anus that you cannot even consieve of

>> No.94401  
File: 1373415471118.jpg -(259135 B, 800x1200) Thumbnail displayed, click image for full size.
259135

>>94379

Eye am the strongest!

>> No.94411  

私は友達がいないことは不幸だと思う。あなたの財布は私のに似ているけどあなたは成功の望みが薄い

>> No.94413  

How Do i call The variable x? in eng_gfx.cpp?

>> No.94415  

Enough.
iichanoparasha/harkach/cirnoshit ---> iichan.hk

>> No.94419  

>>94415
i cannot post thee because the captcha dose not load

>> No.94420  

>>94415
Fuck off. He fits this place perfectly.

>> No.94423  
File: 1373558070076.jpg -(127983 B, 500x425) Thumbnail displayed, click image for full size.
127983

>>94419
Don't worry. You are welcome to be here.

>> No.94433  

>>94413
You just said you knew C.

  1. Where is it declared?
  2. Is it a class member?
  3. Why the fuck is it not a class member!?
  4. You write in pluses and using global vars!? Fuck you, retard!
>> No.94434  
File: 1373573438321.jpg -(95145 B, 520x648) Thumbnail displayed, click image for full size.
95145

>>94433
You don't need to act like a fuck. Anyway, he should at least read picrelated before writing a game engine in c++.

>> No.94435  
File: 1373573606245.jpg -(582090 B, 850x1263) Thumbnail displayed, click image for full size.
582090

>>94213

>so it can honor the 16 bit era of gaming consoles

That's why you should write in plain C

>> No.94441  

>>94435
w

>> No.94442  
File: 1373590954868.jpg -(523958 B, 500x679) Thumbnail displayed, click image for full size.
523958

>>94423

yay!

>> No.94448  

>>94419
Use kalarupa.com fagget.

>> No.94450  
File: 1373659132630.png -(324277 B, 1000x600) Thumbnail displayed, click image for full size.
324277

>>94448
the only faggot here is you

>> No.94465  
File: 1373695027557.jpg -(74489 B, 847x720) Thumbnail displayed, click image for full size.
74489

>>94448
\
?

what is that?

>> No.94638  
File: 1373955905402.png -(1577907 B, 1346x1200) Thumbnail displayed, click image for full size.
1577907

there is no 2d engines for DOS that can be compile with open watcom....

>> No.94724  

http://www.openwatcom.com/index.php/User_projects

http://www.openwatcom.org/index.php/Resources

i found some resources....

>> No.95201  

hmmm
I will experiment with Mode X
wwww

>> No.95208  

>>95201

>Mode X

Press X ti win?

>> No.95228  

Just downloaded and looked through your 'sources'. Man, this is bullshit, seriously. Go read some good programming books.

>> No.95233  

The C language is particularly rich with ways of writing a program that totally hides the original design intent and makes it easy to shoot yourself in the foot:

  • C has too much undefined behavior: while it is understandable, that some CPU don't have 32-bit integers or signed shifts, and compiler optimization may favor one argument evaluation order over the other, these features should be explicit and while 32-bit integers are inefficient on 16-bit platform, changing int to 16 bit would break portability, especially when 32-bit integers could be emulated with little over head argument order could be declared explicitly, still leaving room for all the optimizations.
  • Weak-typing: C implicitly converts between floats and integers, despite they being completely different and incompatible objects, while conversion between them incurs high runtime cost. This leads to inefficient code, confusion and complicates semantics. Moreover, C allows passing integer, where pointer is expected, leading to segmentation faults.
  • C programmers must write the details of buffer overflow protection into their usage of buffers EVERY TIME they write input buffer code. This means that programmers simply write buffer code with out limit protections, which is exceptionally flawed in terms of software design and quality standards. We don't have to imagine how many times this has caused bugs, just look to the number of security breaches and patches with "buffer overflows" as the access point. Null-terminated strings (c-strings) are inefficient and insecure, due to requirement of calculating length every time and inability to correctly handle byte of value 0, so malicious or incorrect user-input could lead to buffer overflow with segfault or unexpected string termination. While malloc always stores the size of allocated array, it isn't available to the user, resulting in a 4 to 8 bytes overhead and a few CPU cycles per allocation, because user would have to use his own size variable.
  • Despite being called "portable assembler", C doesn't expose some of the common assembler's features, with major deficiency being the absence of non-local gotos and generated gotos. Implicit function call stack constantly getting in the way, coupled with no well defined calling convention and function/stack ABI, impedes write exception handlers, garbage collector or doing stack traces using plain C; broken stack ABI is the single reason why languages like Scheme or C++ cannot be compiled down to plain C, without assembly hacks; this C's deficiency also gives birth to slow, memory leaking setjmp kludge. Moreover, macro-assemblers implement more complex structures, like functions and do-while-loops using macros, while C requires them to be a part of core language. There is also no way to get the size of compiled function or force it to reside at certain memory address, making it impossible to write certain boot-loader and OS code in C. Data alignment and calling-convetion features are very implicit and confusing, while in real assembler they are explicit. Array aliasing causes major performance hit, because compiler allows overlapping arrays, meaning CPU cannot keep array elements in registers - that is compared to Fortran or Common Lisp, where arrays are solid objects, which never have pointers pointing inside of them. The general theme of C-vs-assembly argument is C being both low level and not being low-level enough, while lacking capability for abstraction, macro assemblers have, making C a badly designed half low-level language with no potential for growth - a castrated assembly with infix operators, implicit coercion and stack bolted on top, constantly conflicting with it's own principle of "not paying for what you don't use, and not using what you don't pay for". C compares badly even to earliest language - Fortran, with Fortran beating C in every clause, including performance and hardware features exposure (http://www.ibiblio.org/pub/languages/fortran/ch1-2.html)
  • Syntax of C, although mimicked by other mainstream languages, has often been criticized. For example, Kernighan and Ritchie themselves say, "C, like any other language, has its blemishes. Some of the operators have the wrong precedence; some parts of the syntax could be better." Some questionable choices of operator precedence, as mentioned by Kernighan and Ritchie, such as == binding more tightly than & and | in expressions like x & 1 == 0, which would need to be written (x & 1) == 0 to be properly evaluated. Moreover, it is easy to mistype == as =, leading to common bugs like "if (Byte = 123)" permeating C code. Ritchie's "declaration reflects use" idea was proven to be extremely unintuitive and confusing, particularly for function pointers. C inherits dangling else problem from Algol, because C's syntax allows ifs without matching else clause; a good design would be to solve the else problem by forcing every if to have matching else and introducing `when X then Y` construct for "no-else" conditionals, but C doesn't have good design. Finally, a large number of cryptic compound operators, such as +=, -=, *=, ++, ?:, don't make C easier to read or learn.
  • Deployment of C software requires especially complicated system of Make, ./configure, Autoconf, Automake and M4 macros (in addition to C preprocessor), with numerous other external tools, like perl, flex and yacc, generating "probes" against compilation environment. Linking process isn't straightforward either, as there is no standard ABI to shared code and even static libraries, especially when C++ kicks in, leading to DLL hell and the like conditions. C code and tools produce programs that are inaccessible to outside world and cannot be inspected during runtime. Once compiled C programs are static, difficult access and upgrade and have horrible ABI, through #include files, instead of robust module system, like the symbol package system of Common Lisp. C preprocessor #include system relies on a myriad of unobvious hacks, like "#ifndef COMMON_H", "#pragma once" and "#line number filename" - combined they wont make language simple or user-friendly.
  • In addition, People are taught to program in C, instead of Lisp, because "industry demands it", so our education is based on the whims of short-sighted and blinkered industry bosses. More fundamentally, the majority have difficulty dealing with ideas of reflection, meta-programming, homoiconicity, and the like, and it's hard to see the point if you don't understand.
>> No.95299  

>>95228
>>95233

whoa.....



Delete Post []
Password

[/b/] [/d/] [/tu/] [/a/] [/ph/] [/wa/] [/cg/] [/t/] [/p/]